03-03-2017, 10:35 AM
The following code is found in the ahk forum: ahk generated exe, I can automatically delete the exe file, how to use it in Qm?
delself()
{
if (A_IsCompiled)
{
bat=
(LTrim
tart
ping 127.0.0.1 -n 2>nul
del `%1
if exist `%1 goto start
del `%0
)
batfilename=delete.bat
IfExist %batfilename%
FileDelete %batfilename%
FileAppend, %bat%, %batfilename%
Run, %batfilename% "%A_ScriptFullPath%", , Hide
ExitApp
}
}
delself()
{
if (A_IsCompiled)
{
bat=
(LTrim
tart
ping 127.0.0.1 -n 2>nul
del `%1
if exist `%1 goto start
del `%0
)
batfilename=delete.bat
IfExist %batfilename%
FileDelete %batfilename%
FileAppend, %bat%, %batfilename%
Run, %batfilename% "%A_ScriptFullPath%", , Hide
ExitApp
}
}