Sign in to follow this  
Followers 0
Deye

Detect GPT Drive

2 posts in this topic




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

 

1 person likes this

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  
Followers 0