chebarbudo Posted February 25, 2009 Share Posted February 25, 2009 Hi there,I mostly use autoit with installation packages that autounzip to a temporary folder.Example: C:\Documents and Settings\santiago\Local Settings\Temp\ckz_8607\The autounzip then runs the compiled autoit script.Example: C:\Documents and Settings\santiago\Local Settings\Temp\ckz_8607\setup.exeAt the end of the script, I'd like to clean my traces.DirRemove(@ScriptDir)But this doesn't work. Probably because the script cannot delete itself. Thus this is possible with a MS-DOS batch script.Any advice?Santiago Link to comment Share on other sites More sharing options...
BigDod Posted February 25, 2009 Share Posted February 25, 2009 If you had read the FAQ,s at the top of this forum you would have found the answer.Scroll to Q12 Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
cherdeg Posted February 25, 2009 Share Posted February 25, 2009 Any advice? Santiago Jupp: _SuiCide() Run(@TempDir & "\suicide.bat", @TempDir, @SW_HIDE) ; Function _SuiCide to delete the script from the local machine ; ============================================================================================== Func _SuiCide() Local $sCmdFile FileDelete(@TempDir & "\scratch.bat") $sCmdFile = 'ping -n 0 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 ;==>_SuiCide 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