|
-
Nov 6th, 2000, 08:19 AM
#1
Thread Starter
New Member
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?
Live Long and Prosper,
Leo Schelvis
[ECH]
VB6
-
Nov 6th, 2000, 08:54 AM
#2
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
-
Nov 6th, 2000, 09:00 AM
#3
Hyperactive Member
"One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig
[email protected]
"but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.
-
Nov 6th, 2000, 09:33 AM
#4
Thread Starter
New Member
Thanks
Live Long and Prosper,
Leo Schelvis
[ECH]
VB6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|