hisham
IS-IT--Management
- Nov 6, 2000
- 194
Any body knows how to Display C drive serial Number on a web page? It like the getvolumeinformation in VB, I need to create an input text to display it.
Thanks for help
Thanks for help
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
zPassword = InputBox "Enter your password"
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
on error resume next
Set objService = objLocator.ConnectServer(Computername,"root\cimv2","DOMAIN\Administrator",zPassword)
if err.number = 0 then
call HDInfo()
end if
wscript.quit
sub HDInfo()
query = "select manufacturer, description, caption, interfacetype, partitions, size, scsibus, scsitargetid, status " _
& "from win32_diskdrive"
Set objInstance = objService.ExecQuery(query)
for each item in objInstance
if strOS = "2000" then
strDiskDescription = item.Caption
else
strDiskDescription = item.manufacturer & " " & item.Description
end if
zStatus = item.Status
iPartitions = item.partitions
zType = item.interfacetype
zSize = fFormatNum(item.size,false)
zSCSIBusNo = item.scsibus
zSCSIBusID = item.scsitargetid
Set objPartitionSet = item.Associators_("Win32_DiskDriveToDiskPartition","Win32_DiskPartition")
For each objPartition in objPartitionSet
set ObjDriveSet = objPartition.Associators_("Win32_LogicalDiskToPartition","Win32_LogicalDisk")
For each objDrive in objDriveSet
If objPartition.bootpartition then
zDrive = objDrive.Caption & " - Boot Partition"
else
zDrive = objDrive.Caption
end if
zVolume = objDrive.VolumeName
zFileSys = objDrive.FileSystem
zDriveSize = fFormatNum(objDrive.Size,false)
zFreeSpace = fFormatNum(objDrive.FreeSpace,false)
zSerialNumber = objDrive.VolumeSerialNumber
next
next
next
set objDriveSet = nothing
set objPartitionSet = nothing
set objInstance = nothing
End Sub