read BIOS or HDD or Machine Serial Number

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J French

    #16
    Re: read BIOS or HDD or Machine Serial Number

    On Mon, 11 Aug 2003 09:33:47 -0400, "André Joubert"
    <jaji92@sympati co.ca> wrote:
    [color=blue]
    >I am using the same code as you proposed.
    >The invalid handle comes from the createfile.
    >Is there a place where I could get good explanations
    >on the use of CREATEFILE. I am also interested to
    >know if it can be used to communicate between 2
    >programs and if so how.
    >André
    >P.S. In the mean time I will look for a different .VXD[/color]

    Post again tomorrow

    Comment

    • J French

      #17
      Re: read BIOS or HDD or Machine Serial Number

      On Mon, 11 Aug 2003 09:33:47 -0400, "André Joubert"
      <jaji92@sympati co.ca> wrote:
      [color=blue]
      >I am using the same code as you proposed.
      >The invalid handle comes from the createfile.
      >Is there a place where I could get good explanations
      >on the use of CREATEFILE. I am also interested to
      >know if it can be used to communicate between 2
      >programs and if so how.
      >André
      >P.S. In the mean time I will look for a different .VXD[/color]

      The best _initial_ source of info on CreateFile is the Win32
      Programmer's Reference Help File

      After that the Microsoft site

      The error you are getting is: INVALID_HANDLE_ VALUE

      You need to look at Error.LastDllEr ror to get more info

      I would not use CreateFile to communicate between two programs,
      Perhaps if you post how you want the communication to work ...

      Comment

      • André Joubert

        #18
        Re: read BIOS or HDD or Machine Serial Number

        Thank you for this valuable information.

        My question about communications between 2
        programs came up because in the description
        of CREATEFILE it says that it can be used to
        open pipes. I am using pipes with another operating
        system (FLEXOS) to communicate between programs
        and I was wondering if CREATEFILE could do the same
        thing. I don't have a need for it at this moment.

        André


        "J French" <erewhon@nowher e.com> wrote in message
        news:3f389683.3 193278@news.btc lick.com...[color=blue]
        > On Mon, 11 Aug 2003 09:33:47 -0400, "André Joubert"
        > <jaji92@sympati co.ca> wrote:
        >[color=green]
        > >I am using the same code as you proposed.
        > >The invalid handle comes from the createfile.
        > >Is there a place where I could get good explanations
        > >on the use of CREATEFILE. I am also interested to
        > >know if it can be used to communicate between 2
        > >programs and if so how.
        > >André
        > >P.S. In the mean time I will look for a different .VXD[/color]
        >
        > The best _initial_ source of info on CreateFile is the Win32
        > Programmer's Reference Help File
        >
        > After that the Microsoft site
        >
        > The error you are getting is: INVALID_HANDLE_ VALUE
        >
        > You need to look at Error.LastDllEr ror to get more info
        >
        > I would not use CreateFile to communicate between two programs,
        > Perhaps if you post how you want the communication to work ...[/color]


        Comment

        • André Joubert

          #19
          Re: read BIOS or HDD or Machine Serial Number

          Again thanks,
          I found the problem. For non NT windows the
          SMARTVSD.VXD driver has to be moved from windows\system
          to windows\system\ iosubsys in order to be loaded properly.
          I did and it solved the problem
          André


          "J French" <erewhon@nowher e.com> wrote in message
          news:3f373a76.1 312155@news.btc lick.com...[color=blue]
          > On Sun, 10 Aug 2003 15:26:23 -0400, "André Joubert"
          > <jaji92@sympati co.ca> wrote:
          >[color=green]
          > >By the way I use SmartVSD.VXD on Windows XP without any problems, but for
          > >some reason on Windows 98 SE I always get -1 (Invalid handle).
          > >Any idea why?
          > >
          > >André
          > >
          > >P.S. Oops I think I previously sent this to the wrong address. Sorry for
          > >that if you recognize yourself.[/color]
          >
          > You definitely need a different .VXD for 95/98
          > - that may be the problem
          >
          > - the other thing is the CreateFile
          >
          > Private Function OpenSmart(drv_n um As IDE_DRIVE_NUMBE R) As Long
          > If IsWindowsNT Then
          > OpenSmart = CreateFile("\\. \PhysicalDrive" _
          > & CStr(drv_num), _
          > GENERIC_READ Or GENERIC_WRITE, _
          > FILE_SHARE_READ Or FILE_SHARE_WRIT E, _
          > ByVal 0&, OPEN_EXISTING, 0, 0)
          > Else
          > OpenSmart = CreateFile("\\. \SMARTVSD", _
          > 0, 0, ByVal 0&, CREATE_NEW, 0, 0)
          > End If
          > End Function
          >
          > It is also possible that your 95/98 drive does not support SMART
          > - one of my drives certainly does not
          > - oddly enough it is the older one ....
          >
          >[/color]


          Comment

          • André Joubert

            #20
            Re: read BIOS or HDD or Machine Serial Number

            In an other NG some was looking for HDD serial number and it was suggested
            to try a driver that can be found on a site. I when to that site and
            downloaded the driver. On the the same site (I don,t have the reference on
            hand) there were some links on how to build a driver. On of the links was
            about SMART driver and sent me to MSDN. I went there and there was a
            document in the KB that describe the problem.
            André
            P.S. here is the reference




            "J French" <erewhon@nowher e.com> wrote in message
            news:3f39e04d.2 648196@news.btc lick.com...[color=blue]
            > On Tue, 12 Aug 2003 12:54:55 -0400, "André Joubert"
            > <jaji92@sympati co.ca> wrote:
            >[color=green]
            > >Again thanks,
            > > I found the problem. For non NT windows the
            > >SMARTVSD.VXD driver has to be moved from windows\system
            > >to windows\system\ iosubsys in order to be loaded properly.
            > >I did and it solved the problem
            > >André[/color]
            >
            > Good tip - how did you find the solution ?
            >
            >[/color]


            Comment

            • J French

              #21
              Re: read BIOS or HDD or Machine Serial Number

              On Wed, 13 Aug 2003 19:21:16 -0400, "André Joubert"
              <jaji92@sympati co.ca> wrote:
              [color=blue]
              >In an other NG some was looking for HDD serial number and it was suggested
              >to try a driver that can be found on a site. I when to that site and
              >downloaded the driver. On the the same site (I don,t have the reference on
              >hand) there were some links on how to build a driver. On of the links was
              >about SMART driver and sent me to MSDN. I went there and there was a
              >document in the KB that describe the problem.
              >André
              >P.S. here is the reference
              >
              >http://www.winsim.com/diskid32/diskid32.html[/color]

              Gottit - thanks - that is one to remember !

              Comment

              • Ramiro C
                New Member
                • Oct 2005
                • 1

                #22
                response

                Originally posted by Gavin
                Hi, I'm a newbie to programming of any kind. I have posted this to other
                groups in a hope to get a response from anyone.

                Can any one tell me how to make my VB program read the Bios serial number
                (or would HDD be better, or both?) and put that info into VB prog so the
                program won't work on another computer. My program uses an MSAccess table.

                Much appreciated if you can help!

                Thanks
                Gavin

                Gavin

                following the routine for your request

                Sub serial()

                drvpath = "c:"

                Dim fs, d, s, t
                Set fs = CreateObject("S cripting.FileSy stemObject")
                Set d = fs.GetDrive(fs. GetDriveName(fs .GetAbsolutePat hName(drvpath)) )
                Select Case d.DriveType
                Case 0: t = "Desconocid o"
                Case 1: t = "Separable"
                Case 2: t = "Fijo"
                Case 3: t = "Red"
                Case 4: t = "CD-ROM"
                Case 5: t = "Disco RAM "
                End Select
                s = "Unidad " & d.DriveLetter & ": - " & t

                ' this is a comment next line print out the hdd serial number

                s = s & vbCrLf & "NS: " & d.serialnumber
                MsgBox s
                End Sub

                Comment

                Working...