|
- Func _AutoPart($AutoPart)
- $bootMod = _bootMode()
- Run($tempPath & "" & @OSArch & "\dqi.exe")
- $Hpart = WinWait("DQI", "开始分区", 60)
- If Not $Hpart Then Return
- For $i = 1 To 10
- Sleep(1000)
- $pos = WinGetPos($Hpart)
- If Not @error Then
- If $pos[2] > 100 And $pos[3] > 100 Then ExitLoop
- EndIf
- Next
- If $bootMod Then ControlSend($Hpart, "", 13, $bootMod)
- Sleep(1000)
- If $AutoPart > 1 Then ControlSend($Hpart, "", 9, $AutoPart)
- Sleep(1000)
- If $AutoPart <> 'm' Then ControlClick($Hpart, "", 18)
- $HpartFast = WinWait("警告", "全盘将被清空")
- For $i = 1 To 10
- Sleep(1000)
- $pos = WinGetPos($HpartFast)
- If Not @error Then
- If $pos[2] > 100 And $pos[3] > 100 Then ExitLoop
- EndIf
- Next
- ControlClick($HpartFast, "", 6)
- $HpartYN = WinWait("恭喜", "分区完成", 120)
- WinClose($HpartYN)
- Sleep(2000)
- ShellExecuteWait($Tpath & "\pecmd.exe", "show")
- Sleep(5000)
- EndFunc ;==>_AutoPart
- Func _bootMode()
- Dim $bootMod = 0
- $botmod = _GetFirmwareTypeString()
- If $botmod = "Uefi" Then $bootMod = 'g'
- If $botmod = "Bios" Then $bootMod = 'm'
- Return $bootMod
- EndFunc ;==>_bootMode
- Func _GetFirmwareType()
- Local $aCall = DllCall("Kernel32.dll", "int", "GetFirmwareType", "int*", 0)
- If Not @error And $aCall[0] Then Return $aCall[1]
- Return SetError(1, 0, 0)
- EndFunc ;==>_GetFirmwareType
- Func _GetFirmwareTypeString()
- Local $iType = _GetFirmwareType()
- Local $asTypes[] = ["Unknown", "Bios", "Uefi", "Max"]
- Return $asTypes[$iType]
- EndFunc ;==>_GetFirmwareTypeString
复制代码
au3代码 |
|