Results 1 to 8 of 8

Thread: [RESOLVED] System and hardware details?

  1. #1

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Resolved [RESOLVED] System and hardware details?

    I'm looking for a way to find out several informations, such as hard disk serial number, motherboard serial number, ammount of ram, file system type (ntfs or fat) and cd/dvd serial number...
    I'v searched along the forum but can't reach any concrete information. Could someone enlighten me?
    cheers
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: System and hardware details?

    Some of the hardware informations (but mostly software) can be retrieved with an Environ() statement. For example:
    VB Code:
    1. Debug.Print Environ("PROCESSOR_ARCHITECTURE")
    2. 'loop thorugh Environ() from Environ(1) to about 100 to get all the other data
    Btw... i heard somewhere that Environ() variables/constants can be changed by the user... not sure. However, other informations can be usually retrieved with APIs. Take a look at allapi.net.

  3. #3

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: System and hardware details?

    erm that's not exatly what i was looking for...

    And yes, that list can easely be changed by user by using the set command in dos mode (temporarely) or non temporarely changing: "System Properties>Advanced>Environment Variables>System variables"
    Each one of those can be edited or can even be deleted, on next boot, the system will be updated.
    About the allapi.net, yes i checked it, although i don't know what to look for exactly, that's why i asked
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  4. #4
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: System and hardware details?

    Fox-Info gets a fair bit of info. Try the codebank - search for something like "shareware registration" for other code.

  5. #5
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: System and hardware details?

    Quote Originally Posted by TDQWERTY
    And yes, that list can easely be changed by user by using the set command in dos mode (temporarely) or non temporarely changing: "System Properties>Advanced>Environment Variables>System variables" Each one of those can be edited or can even be deleted, on next boot, the system will be updated.
    We live and we learn

  6. #6
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: System and hardware details?

    I think WMI scripts can do this for you. I dont remember all of them right now, but I will edit this post whenever I will get the answers.

    Motherboard serial number
    VB Code:
    1. Public Function MBSerialNumber() As String
    2. Dim objs As Object
    3. Dim obj As Object
    4. Dim WMI As Object
    5. Dim sAns As String
    6.  
    7.  
    8. Set WMI = GetObject("WinMgmts:")
    9. Set objs = WMI.InstancesOf("Win32_BaseBoard")
    10. For Each obj In objs
    11.   sAns = sAns & obj.SerialNumber
    12.  If sAns < objs.Count Then sAns = sAns & ","
    13. Next
    14. MBSerialNumber = sAns
    15. End Function
    HDD Serial Number, Not Volume Number
    VB Code:
    1. Private Type DRIVEINFO
    2.     HDDModel As String
    3.     HDDIType As String
    4.     HDDSerialNum As String
    5. End Type
    6. Dim info As DRIVEINFO
    7.  
    8. Public Function HDDSerialNumber()
    9.  
    10.     Dim objs As Object
    11.     Dim obj As Object
    12.     Dim WMI As Object
    13.  
    14.     Set WMI = GetObject("WinMgmts:")
    15.    
    16.     Set objs = WMI.InstancesOf("Win32_DiskDrive")
    17.     For Each obj In objs
    18.         info.HDDModel = obj.Model
    19.         info.HDDIType = obj.InterfaceType
    20.     Next obj
    21.    
    22.     Set objs = WMI.InstancesOf("Win32_PhysicalMedia")
    23.     For Each obj In objs
    24.         info.HDDSerialNum = obj.SerialNumber
    25.     Next obj
    26.    
    27.     Text1.Text = info.HDDModel & vbCrLf & vbCrLf & info.HDDIType & _
    28.             vbCrLf & vbCrLf & info.HDDSerialNum
    29. End Function
    Amount Of RAM
    VB Code:
    1. Private Function MemRAMAmount() As Long
    2.  
    3.     Dim objs As Object
    4.     Dim obj As Object
    5.     Dim WMI As Object
    6.     Dim ans As String
    7.     Dim llong As Long
    8.    
    9.     Set WMI = GetObject("WinMgmts:")
    10.    
    11.     Set objs = WMI.InstancesOf("Win32_OperatingSystem")
    12.     For Each obj In objs
    13.         llong = obj.TotalVisibleMemorySize
    14.     Next obj
    15.    
    16.     'It's in KB I think
    17.     MemRAMAmount = llong
    18. End Function
    See the attached project for the detailed Drive information, including FileSystem.
    Attached Files Attached Files
    Last edited by Harsh Gupta; Oct 3rd, 2006 at 07:29 PM.
    Show Appreciation. Rate Posts.

  7. #7
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: System and hardware details?

    I am not sure about CD serial number. All I could get its Volume number, but for it, you would require to insert a CD into it.
    Show Appreciation. Rate Posts.

  8. #8

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Re: System and hardware details?

    Thanks a lot! it already help me a lot
    The cd would be a secondary idea so...
    Apreceated the help as always
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width