I want to extract the following information from the system:
*Windows build
*the volume number of the harddisk
Does anybody know how to do this?
Printable View
I want to extract the following information from the system:
*Windows build
*the volume number of the harddisk
Does anybody know how to do this?
Try this for the volume information. I have one for
the windows build somewhere but I can't locate it!
API for module or whatever:
Private Const MAX_FILENAME_LEN = 256
Private Declare Function GetVolumeInformation& Lib "kernel32" Alias "GetVolumeInformationA" _
(ByVal lpRootPathName As String, ByVal pVolumeNameBuffer As String, _
ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, lpFileSystemFlags As Long, _
ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long)
'===============Volume serial number===================
Public Function VolumeSerialNumber(DriveLetter As String) As Long
'Returns Zero if no serial number could be found
Dim ser As Long
Dim s As String * MAX_FILENAME_LEN
Dim s2 As String * MAX_FILENAME_LEN
Dim i As Long
Dim j As Long
Call GetVolumeInformation(DriveLetter + ":\" & Chr$(0), s, MAX_FILENAME_LEN, ser, i, j, s2, MAX_FILENAME_LEN)
VolumeSerialNumber = ser
End Function
'==============Volume name information =============
Public Function GetVolumeName(DriveLetter As String) As String
Dim ser As Long
Dim s As String * MAX_FILENAME_LEN
Dim s2 As String * MAX_FILENAME_LEN
Dim i As Long
Dim j As Long
Call GetVolumeInformation(DriveLetter + ":\" & Chr$(0), s, MAX_FILENAME_LEN, ser, i, j, s2, MAX_FILENAME_LEN)
VolumeName = Left$(s, InStr(s, Chr$(0)) - 1)
End Function
sys information...
http://forums.vb-world.net/showthrea...threadid=38157
td.
Thanks for all help