На WSH:
Код:
Option Explicit
Dim strComputer
Dim objSWbemObjectEx
Dim strSystemDrive
strComputer = "."
With WScript.CreateObject("WbemScripting.SWbemLocator").ConnectServer(strComputer, "root\cimv2")
For Each objSWbemObjectEx In .ExecQuery("SELECT * FROM Win32_OperatingSystem")
strSystemDrive = objSWbemObjectEx.SystemDrive
Exit For
Next
For Each objSWbemObjectEx In .ExecQuery("ASSOCIATORS OF {Win32_LogicalDisk.DeviceID='" & .Get("Win32_LogicalDisk.DeviceID='" & strSystemDrive & "'").DeviceID & "'} WHERE ResultClass = Win32_DiskPartition")
WScript.Echo "System drive:", strSystemDrive
WScript.Echo "Partition: ", objSWbemObjectEx.DeviceID
WScript.Echo "Type: ", objSWbemObjectEx.Type
If UCase(Left(objSWbemObjectEx.Type, 3)) = "GPT" Then
WScript.Echo "GPT"
Else
WScript.Echo "Not GPT"
End If
Next
End With
WScript.Quit 0