[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 :)
Re: System and hardware details?
Some of the hardware informations (but mostly software) can be retrieved with an Environ() statement. For example:
VB Code:
Debug.Print Environ("PROCESSOR_ARCHITECTURE")
'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.
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 :)
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.
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 ;)
1 Attachment(s)
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:
Public Function MBSerialNumber() As String
Dim objs As Object
Dim obj As Object
Dim WMI As Object
Dim sAns As String
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_BaseBoard")
For Each obj In objs
sAns = sAns & obj.SerialNumber
If sAns < objs.Count Then sAns = sAns & ","
Next
MBSerialNumber = sAns
End Function
HDD Serial Number, Not Volume Number
VB Code:
Private Type DRIVEINFO
HDDModel As String
HDDIType As String
HDDSerialNum As String
End Type
Dim info As DRIVEINFO
Public Function HDDSerialNumber()
Dim objs As Object
Dim obj As Object
Dim WMI As Object
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_DiskDrive")
For Each obj In objs
info.HDDModel = obj.Model
info.HDDIType = obj.InterfaceType
Next obj
Set objs = WMI.InstancesOf("Win32_PhysicalMedia")
For Each obj In objs
info.HDDSerialNum = obj.SerialNumber
Next obj
Text1.Text = info.HDDModel & vbCrLf & vbCrLf & info.HDDIType & _
vbCrLf & vbCrLf & info.HDDSerialNum
End Function
Amount Of RAM
VB Code:
Private Function MemRAMAmount() As Long
Dim objs As Object
Dim obj As Object
Dim WMI As Object
Dim ans As String
Dim llong As Long
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_OperatingSystem")
For Each obj In objs
llong = obj.TotalVisibleMemorySize
Next obj
'It's in KB I think
MemRAMAmount = llong
End Function
See the attached project for the detailed Drive information, including FileSystem.
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.
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 :)