testbytest Posted October 30, 2008 Share Posted October 30, 2008 (edited) hi i use Aut2Exe to create a 1.exe file how can i use 1.exe to delete 1.exe (delete itself) and i must use 1.exe in folder C:\Documents and Settings\All Users\「開始」功能表\程式集\啟動\ (the patch is C:\Documents and Settings\All Users\Start menu\program\start\ in english system) thanks Edited October 30, 2008 by testbytest Link to comment Share on other sites More sharing options...
monoceres Posted October 30, 2008 Share Posted October 30, 2008 Read the FAQhttp://www.autoitscript.com/forum/index.php?showtopic=37289 Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
testbytest Posted October 30, 2008 Author Share Posted October 30, 2008 yes i find it before but i try used it it return a error message line:-1 error: Variable used without being declared. my script is Run(@ComSpec &" /k dir ") _SelfDelete($iDelay = 0) Exit Func _SelfDelete($iDelay = 0) Local $sCmdFile FileDelete(@TempDir & "\scratch.bat") $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _ & ':loop' & @CRLF _ & 'del "' & @ScriptFullPath & '"' & @CRLF _ & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _ & 'del ' & @TempDir & '\scratch.bat' FileWrite(@TempDir & "\scratch.bat", $sCmdFile) Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE) EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted October 30, 2008 Developers Share Posted October 30, 2008 Use au3check to help you with these type of "simple"syntax issues. _SelfDelete($iDelay = 0) should be: _SelfDelete() Because it cannot find $iDelay. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
testbytest Posted October 30, 2008 Author Share Posted October 30, 2008 thanks very mush Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now