Moderators SmOke_N Posted September 4, 2006 Moderators Share Posted September 4, 2006 (edited) Compile this then run the exe, then check and the exe will be gone. MsgBox(0,"", "It does work") _SelfDelete() 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 And then say sorry to Smoke_NDamn... I was waiting to see if he stepped to I'm a complete invalid status before someone gave him the "complete" hold your hand answer. Edited September 4, 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...
Jabberwock Posted September 4, 2006 Author Share Posted September 4, 2006 You just changed your fucking code, there you go, now eat a fucking sock, it was you ALL ALONG Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 4, 2006 Moderators Share Posted September 4, 2006 (edited) You just changed your fucking code, there you go, now eat a fucking sock, it was you ALL ALONGI'm going to try and ask this question politely.What did I change?Edit:After 12... / and ? look the same EDIT2OH I SEE... I didn't "INVOKE" the function.. well I'm sorry, but I mentioned onautoitexit earlier, but hat wasn't good enough... you want the .. please i'm a moron, please hold my hand every step of the way example. Edited September 4, 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...
Jabberwock Posted September 4, 2006 Author Share Posted September 4, 2006 At first you said all you needed was "SelfDelete " <---WITH A SPACE Then you gave me some random func that i had no idea would actually delete it self once executed, then you say COPY AND PASTE EXACTLY, which i did, then run it, which i did, Nothing happened but your scarastic msgbox, then you edit it and claim nothing was changed, _SelfDelete() was added to execute the func, the core code may of been there all along, but you were defintily mistaken. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 4, 2006 Moderators Share Posted September 4, 2006 At first you said all you needed was "SelfDelete " <---WITH A SPACEThen you gave me some random func that i had no idea would actually delete it self once executed, then you say COPY AND PASTE EXACTLY, which i did, then run it, which i did, Nothing happened but your scarastic msgbox, then you edit it and claim nothing was changed, _SelfDelete() was added to execute the func, the core code may of been there all along, but you were defintily mistaken.do you ever see a function that is invoked that you don't specifically call? Do you make your woman do all the work as well? 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...
Jabberwock Posted September 4, 2006 Author Share Posted September 4, 2006 You keep editing your stuff, please.... In the VERY begging you gave me no func what so ever, i'm not a fucking idiot, ("SelfDelete " <--*Space*) was all that was given, then later you post some Func that defines the selfdelete which Really does not even look like it would make it delete the file, which i was mistaken there. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 4, 2006 Moderators Share Posted September 4, 2006 (edited) You keep editing your stuff, please.... In the VERY begging you gave me no func what so ever, i'm not a fucking idiot[, ("SelfDelete " <--*Space*) was all that was given, then later you post some Func that defines the selfdelete which Really does not even look like it would make it delete the file, which i was mistaken there.That's still up for debate! If you don't know how to make a function run "after" someone has given it to you, then yes, you most certainly look like an idiot. Edit: And you drink a 12 / 13 / 18 pack and answer stupid questions like what you've posted and see how many times you edit. Edited September 4, 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...
BigDod Posted September 4, 2006 Share Posted September 4, 2006 You keep editing your stuff, please....In the VERY begging you gave me no func what so ever, i'm not a fucking idiot, ("SelfDelete " <--*Space*) was all that was given, then later you post some Func that defines the selfdelete which Really does not even look like it would make it delete the file, which i was mistaken there.Take a chill pill and go and calm down, there is no reason for all the swearing.Smoke_N gave you as much of a hint how to do it as anyone would have, you have to put some thought into it yourself. 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...
BigDod Posted September 4, 2006 Share Posted September 4, 2006 @JabberwockPlease stop sending me PMs about this and just admit that you did something wrong.Download the latest SciTe and try it again and it should work. If it does not work there is something wrong with your setup. 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...
Sascha Posted September 1, 2008 Share Posted September 1, 2008 Example script works good. Thank you. Regards Sascha 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