Deye Posted October 10, 2015 Share Posted October 10, 2015 This code is designed for powershellHow can it be converted to autoit ?got it from http://stackoverflow.com/questions/3840870/detect-gpt-and-mbr-partitions-with-powershellgwmi - query "Select * from Win32_DiskPartition WHERE Index = 0" | Select - Object DiskIndex, @{Name = "GPT";Expression={$_.Type.StartsWith("GPT")}} Link to comment Share on other sites More sharing options...
MyEarth Posted October 11, 2015 Share Posted October 11, 2015 UntestedConsoleWrite("_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 Deye and behdadsoft 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now