myspacee Posted November 12, 2009 Posted November 12, 2009 (edited) hello to all, i'm scripting about ghost image automation in Bartpe environment. Tool check DVD root for *.gho images and restore without user intervention. (think for massive industry PC production) I'm searching function to understand if connect drive is found or not before attempts to restore image file. See DriveGetDrive, DriveGetFileSystem, DriveGetLabel, DriveGetType, DriveSetLabel, DriveSpaceFree, DriveSpaceTotal, DriveStatus func, but all point to Windows letters (C: d: etc) I search for a function that understand if disk is recognized or not, also if not contains a defined partition. Anyone can help me ? thank you, m. Edited November 12, 2009 by myspacee
trancexx Posted November 13, 2009 Posted November 13, 2009 That's impossible to do with AutoIt. ♡♡♡ . eMyvnE
myspacee Posted November 13, 2009 Author Posted November 13, 2009 thank you for reply, so without use WMI is not possible with native AI func: #include <Array.au3> $arrResults=_GetLogicalDriveToPartition() _ArrayDisplay($arrResults) Func _GetLogicalDriveToPartition() $objWMIService = ObjGet("winmgmts:{impersonationLevel=Impersonate}!\\.\root\cimv2") If Not IsObj($objWMIService) Then Return -1 ;Failed to Connect to WMI on Local Machine Local $arr[1][2] $colDevice = $objWMIService.ExecQuery("SELECT * from Win32_LogicalDiskToPartition") For $objItem in $colDevice ReDim $arr[UBound($arr)+1][2] $arr[UBound($arr)-1][0]=StringTrimLeft($objItem.Antecedent,StringInStr($objItem.Antecedent,"=",0,-1)) $arr[UBound($arr)-1][1]=StringTrimLeft($objItem.Dependent,StringInstr($objItem.Dependent,"=",0,-1)) Next $colDevice=0 $objWMIService=0 $arr[0][0]="Disk #, Partition #" $arr[0][1]="Drive Letter" Return $arr EndFunc any other idea ? m.
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