本帖最后由 dnvplj 于 2015-6-18 16:08 编辑
请问各位朋友:如何判断本程序是否在硬盘上运行,如果在硬盘上运行,在执行完任务后删除自己,否则退出。编译后的文件名为:Software.exe#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 297, 160, 192, 124)
$Group1 = GUICtrlCreateGroup("", 8, 8, 281, 97)
$Label1 = GUICtrlCreateLabel("如果在硬盘上运行", 64, 32, 172, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("任务完成删除自己", 64, 64, 172, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("执 行", 112, 112, 73, 33)
$Button2 = GUICtrlCreateButton("退 出", 192, 112, 73, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Set1()
Case $Button2
Exit
EndSwitch
WEnd
Func Set1()
RunWait('c:\Soft\Setup.exe')
EndFunc ;==>Set1
|