Hello,
I found a script code below from the post at about converting logical disk to physical disk.
I need the code to the convert the logical disk to physical disk number and the mount associated with the disk number.
I like to know if there is any way this code can edited to get the mount point associated with the disk number.
I appreciate very much for any suggestion or directions.
Thanks.
I found a script code below from the post at about converting logical disk to physical disk.
I need the code to the convert the logical disk to physical disk number and the mount associated with the disk number.
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colDiskDrives = objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive")
For Each objDrive In colDiskDrives
Wscript.Echo "Physical Disk: " & objDrive.Caption & " -- " & objDrive.DeviceID
strDeviceID = Replace(objDrive.DeviceID, "\", "\\")
Set colPartitions = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_DiskDrive.DeviceID=""" & _
strDeviceID & """} WHERE AssocClass = " & _
"Win32_DiskDriveToDiskPartition")
For Each objPartition In colPartitions
Wscript.Echo "Disk Partition: " & objPartition.DeviceID
Set colLogicalDisks = objWMIService.ExecQuery _
("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=""" & _
objPartition.DeviceID & """} WHERE AssocClass = " & _
"Win32_LogicalDiskToPartition")
For Each objLogicalDisk In colLogicalDisks
If objLogicalDisk.VolumeName = "System" Then
WScript.Echo "Logical Disk: " & objLogicalDisk.DeviceID
End If
Next
Wscript.Echo
Next
Wscript.Echo
Next
I like to know if there is any way this code can edited to get the mount point associated with the disk number.
I appreciate very much for any suggestion or directions.
Thanks.