查看完整版本: 快速分区工具(2、3、4、5个分区)

似水年华 2008-8-8 09:26 PM

快速分区工具(2、3、4、5个分区)

[indent]#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=J:\小工具\分区工具.kxf
$Form1 = GUICreate("硬盘快速分区工具", 435, 204, 204, 132)
$Group1 = GUICtrlCreateGroup(" 选择硬盘分区个数 ", 16, 16, 209, 169)
$Hdd2 = GUICtrlCreateRadio("将硬盘分 2 个区", 44, 45, 145, 33)
$Hdd3 = GUICtrlCreateRadio("将硬盘分 3 个区", 44, 70, 145, 33)
$Hdd4 = GUICtrlCreateRadio("将硬盘分 4 个区", 44, 95, 145, 33)
GUICtrlSetState(-1, $GUI_CHECKED)
$Hdd5 = GUICtrlCreateRadio("将硬盘分 5 个区", 44, 120, 113, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup(" 提  示 ", 240, 16, 177, 129)
$Label1 = GUICtrlCreateLabel("对硬盘进行分区操作,会", 275, 55, 136, 17)
$Label2 = GUICtrlCreateLabel("清除硬盘中保存的所有数据,", 251, 80, 160, 17)
$Label3 = GUICtrlCreateLabel("请谨慎操作!", 251, 105, 76, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("执   行", 248, 160, 75, 25, 0)
$Button2 = GUICtrlCreateButton("放   弃", 336, 160, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;定义硬盘盘符数组
Dim $pan[24]=["z","y","x","w","v","u","t","s","r","q","p","o","n","m","l","k","j","i","h","g","f","e","d","c"]
;判断配置文件是否存在。如果存在则读取配置文件中工作目录、GHOST32软件路径及GHO文件的路径,如果配置文件不存在则给出提示窗口。
if FileExists("HDD-N.INI") Then
$GhostPath = IniRead("HDD-N.INI","FilePath","GhostPath","")
Else
MsgBox(0,"文件没有被发现","没有发现配置文件!",10)
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE  
   Exit
  Case $Button2     
   Exit
  Case $Button1
   IF GUICtrlRead($Hdd2) = $GUI_CHECKED Then   
    For $i=0 To 24
     if $i < 24  Then
      if FileExists($pan[$i] & ":\" & $GhostPath) Then
       $gho= $pan[$i] & ":\" & $GhostPath & "\HDD-2.GHO"
       $ghost= $pan[$i] & ":\" & $GhostPath & "\Ghost32.exe"
       run($ghost&" "&"-clone,mode=load,src="&$gho&",dst=1","",@SW_HIDE)
       Exit
      EndIf
     Else
      MsgBox(0,"文件没有被发现","配置文件中指定的文件没有被发现!",10)
     EndIf
    Next
   EndIf
   IF GUICtrlRead($Hdd3) = $GUI_CHECKED Then   
    For $i=0 To 24
     if $i < 24  Then
      if FileExists($pan[$i] & ":\" & $GhostPath) Then
       $gho= $pan[$i] & ":\" & $GhostPath & "\HDD-3.GHO"
       $ghost= $pan[$i] & ":\" & $GhostPath & "\Ghost32.exe"
       run($ghost&" "&"-clone,mode=load,src="&$gho&",dst=1","",@SW_HIDE)
       Exit
      EndIf
     Else
      MsgBox(0,"文件没有被发现","配置文件中指定的文件没有被发现!",10)
     EndIf
    Next
   EndIf
   
   IF GUICtrlRead($Hdd4) = $GUI_CHECKED Then   
    For $i=0 To 24
     if $i < 24  Then
      if FileExists($pan[$i] & ":\" & $GhostPath) Then
       $gho= $pan[$i] & ":\" & $GhostPath & "\HDD-4.GHO"
       $ghost= $pan[$i] & ":\" & $GhostPath & "\Ghost32.exe"
       run($ghost&" "&"-clone,mode=load,src="&$gho&",dst=1","",@SW_HIDE)
       Exit
      EndIf
     Else
      MsgBox(0,"文件没有被发现","配置文件中指定的文件没有被发现!",10)
     EndIf
    Next
   EndIf
   IF GUICtrlRead($Hdd5) = $GUI_CHECKED Then   
    For $i=0 To 24
     if $i < 24  Then
      if FileExists($pan[$i] & ":\" & $GhostPath) Then
       $gho= $pan[$i] & ":\" & $GhostPath & "\HDD-5.GHO"
       $ghost= $pan[$i] & ":\" & $GhostPath & "\Ghost32.exe"
       run($ghost&" "&"-clone,mode=load,src="&$gho&",dst=1","",@SW_HIDE)
       Exit
      EndIf
     Else
      MsgBox(0,"文件没有被发现","配置文件中指定的文件没有被发现!",10)
     EndIf
    Next
   EndIf
EndSwitch
WEnd[/indent]

lantu 2008-9-21 02:10 PM

必须要先做一些gho文件啊
页: [1]
查看完整版本: 快速分区工具(2、3、4、5个分区)
Google