我搞定了....
$g_szVersion = "My Script 1.1"
If WinExists($g_szVersion) Then Exit ; 此脚本已经运行了
AutoItWinSetTitle($g_szVersion)
#include <GUIConstants.au3>
fileinstall("ad.jpg",@scriptdir &"\ad.jpg")
$imgsoft = iniread(@scriptdir &"\gutools.ini","IMG软件","imgsoft","")
$imgfile = iniread(@scriptdir &"\gutools.ini","IMG文件","imgfile","")
$upsoft = iniread(@scriptdir &"\gutools.ini","更新软件","upsoft","")
$updisk = iniread(@scriptdir &"\gutools.ini","更新盘符","updisk","")
$Form1 = GUICreate("GU三层游戏更新-辅助工具[O盘]V2008.11.25", 364, 203, 306, 160)
$Button1 = GUICtrlCreateButton("加载镜像文件", 8, 80, 81, 41, 0)
$Button2 = GUICtrlCreateButton("弹出镜像文件", 96, 80, 81, 41, 0)
$Button3 = GUICtrlCreateButton("开始游戏升级", 184, 80, 81, 41, 0)
$Button4 = GUICtrlCreateButton("停止游戏升级", 272, 80, 81, 41, 0)
$Label2 = GUICtrlCreateLabel("版权所有:佛山市容桂麒丰网络有限公司 www.266168.com", 22, 180, 342, 40)
GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif")
$Button5 = GUICtrlCreateButton("关闭多余虚拟盘", 8, 130, 168, 41, 0)
$Button6 = GUICtrlCreateButton("关于本工具", 184, 130, 168, 41, 0)
$Pic1 = GUICtrlCreatePic(@scriptdir &"\ad.JPG", 8, 2, 345, 76, BitOR($SS_NOTIFY,$WS_GROUP))
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Select
case $nmsg = $button1
if fileexists($updisk) Then
Msgbox("64","温馨提示:","您是否已经加载了镜像文件,请确认后在使用!","2")
Else
msgbox ("64","温馨提示:","开始加载IMG文件,","2")
run($imgsoft & ' ' & $updisk & '\ ' & ' ' & $imgfile)
Sleep(2000)
msgbox("4096","温馨提示:","镜像文件加载成功,盘符为 O 盘","2")
EndIf
case $nmsg = $button2
if fileexists($updisk) Then
msgbox("32","温馨提示","现在关闭IMG镜像","2")
run($imgsoft & ' ' & 'o:')
Sleep(1000)
run($imgsoft & ' ' & 'p:')
Else
msgbox("32","温馨提示","你还没有加载IMG镜像","2")
EndIf
Case $nmsg = $button3
if fileexists($updisk) Then
run($upsoft)
Else
msgbox("64","温馨提示:","你还没有加载IMG镜像,请点[加载镜像文件]","2")
EndIf
case $nmsg = $button4
if processclose($upsoft) Then
processclose($upsoft)
Sleep(1000)
msgbox("64","温馨提示:","游戏更新停止","2")
Else
MsgBox("32", "温馨提示","你还没有运行游戏自动更新软件","2")
EndIf
case $nmsg = $Button5
msgbox("64","温馨提示:","关闭多余的虚拟盘所需要90秒,正在关闭中...请耐心等待!!!","90")
run($imgsoft & ' ' & 'f:')
Sleep(1000)
run($imgsoft & ' ' & 'g:')
Sleep(1000)
run($imgsoft & ' ' & 'h:')
Sleep(1000)
run($imgsoft & ' ' & 'i:')
Sleep(1000)
run($imgsoft & ' ' & 'j:')
Sleep(1000)
run($imgsoft & ' ' & 'k:')
Sleep(1000)
run($imgsoft & ' ' & 'l:')
Sleep(1000)
run($imgsoft & ' ' & 'n:')
Sleep(1000)
run($imgsoft & ' ' & 'm:')
Sleep(1000)
run($imgsoft & ' ' & 'o:')
Sleep(1000)
run($imgsoft & ' ' & 'p:')
Sleep(1000)
run($imgsoft & ' ' & 'q:')
Sleep(1000)
run($imgsoft & ' ' & 'r:')
Sleep(1000)
run($imgsoft & ' ' & 's:')
Sleep(1000)
run($imgsoft & ' ' & 't:')
Sleep(1000)
run($imgsoft & ' ' & 'u:')
Sleep(1000)
run($imgsoft & ' ' & 'v:')
Sleep(1000)
run($imgsoft & ' ' & 'w:')
Sleep(1000)
run($imgsoft & ' ' & 'x:')
Sleep(1000)
run($imgsoft & ' ' & 'y:')
Sleep(1000)
run($imgsoft & ' ' & 'z:')
msgbox("64","温馨提示:","关闭多余的虚拟盘完成","3")
case $nmsg = $button6
msgbox("64","温馨提示:","程序设计:梁宇 版本号:V2008.11.25 联系QQ:228541637","30")
EndSelect
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|