AntiVirusGuy Posted May 23, 2006 Share Posted May 23, 2006 Does anyone no how to delet a script when it is done as not to leave anything behind? For central deployment Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 23, 2006 Moderators Share Posted May 23, 2006 (edited) Does anyone no how to delet a script when it is done as not to leave anything behind? For central deploymentIn SciTe type in SelfDelete + SpaceBar Edited May 23, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
AntiVirusGuy Posted May 23, 2006 Author Share Posted May 23, 2006 hey thanks !!! I take it this needs to be at the end of my script Link to comment Share on other sites More sharing options...
CyberSlug Posted May 23, 2006 Share Posted May 23, 2006 Very beginning or very end are the usual places you can put it.Just remember make a call to _SelfDelete() before your script exits.You could also use the OnAutoItExit feature (might require beta):Func OnAutoItExit() ;following code causes script to delete itself Local $sCmdFile FileDelete(@TempDir & "\Scratch.bat") $sCmdFile = ':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 Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
AntiVirusGuy Posted May 24, 2006 Author Share Posted May 24, 2006 does not work I must be spacing it what am I doing wrong? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted May 24, 2006 Share Posted May 24, 2006 Func OnAutoItExit() ;following code causes script to delete itself Local $sCmdFile FileDelete(@TempDir & "\Scratch.bat") $sCmdFile = ':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...
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