Hi,
I am creating an automated Windows installer using WIM images. I've got most of it covered execpt for converting a parition object into a drive letter. I took a look at this code:
and it works, but I'm confused. How can I fix it so it converts a partition object, like "Disk #0, Partition #1", into a drive letter, like "C:\"?
I am creating an automated Windows installer using WIM images. I've got most of it covered execpt for converting a parition object into a drive letter. I took a look at this code:
[ autoit ]
$oWMISvc = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2") $colDiskDrives = $oWMISvc.ExecQuery("SELECT * FROM Win32_DiskDrive") For $oDiskDrive In $colDiskDrives ConsoleWrite("DiskDrive = " & $oDiskDrive.DeviceId & " Caption = " & $oDiskDrive.Caption & @LF) $sQuery = "ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" & $oDiskDrive.DeviceId & "'} WHERE AssocClass = Win32_DiskDriveToDiskPartition" $colPartitions = $oWMISvc.ExecQuery($sQuery) For $oPartition In $colPartitions ConsoleWrite(@TAB & "Partition = " & $oPartition.DeviceId & @LF) $sQuery = "ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" & $oPartition.DeviceId & "'} WHERE AssocClass = Win32_LogicalDiskToPartition" $colLogicalDisks = $oWMISvc.ExecQuery($sQuery) For $oLogicalDisk In $colLogicalDisks ConsoleWrite(@TAB & @TAB & "LogicalDisk = " & $oLogicalDisk.DeviceId & @LF) Next Next Next