Jump to content
Sign in to follow this  
Deye

Detect GPT Drive

Recommended Posts

MyEarth

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

 

  • Like 1

Share this post


Link to post
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
Sign in to follow this  

×