Jump to content

Detect GPT Drive


Deye
 Share

Recommended Posts

Untested

ConsoleWrite("_IsDiskGPT: " & _IsDiskGPT() & @CRLF)

Func _IsDiskGPT()
    Local $oWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
    If Not IsObj($oWMIService) Then Return SetError(1, 0, 0)
    Local $o_ProcessInfo = $oWMIService.ExecQuery("Select * from Win32_DiskPartition WHERE Index = 0")
    Local $sReturn
    For $o_ObjProcess In $o_ProcessInfo
        $sReturn = $o_ObjProcess.Type
        ExitLoop
    Next
    If StringInStr($sReturn, "GPT") Then Return 1
    Return 0
EndFunc   ;==>_IsDiskGPT

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...