AntiVirusGuy Posted May 23, 2006 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
Moderators SmOke_N Posted May 23, 2006 Moderators 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.
AntiVirusGuy Posted May 23, 2006 Author Posted May 23, 2006 hey thanks !!! I take it this needs to be at the end of my script
CyberSlug Posted May 23, 2006 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!
AntiVirusGuy Posted May 24, 2006 Author Posted May 24, 2006 does not work I must be spacing it what am I doing wrong?
Thatsgreat2345 Posted May 24, 2006 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
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