Jump to content
Sign in to follow this  
Jabberwock

Delete file upon exit?

Recommended Posts

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_N

Damn... 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 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.

Share this post


Link to post
Share on other sites

You just changed your fucking code, there you go, now eat a fucking sock, it was you ALL ALONG

I'm going to try and ask this question politely.

What did I change?

Edit:

After 12... / and ? look the same :P

EDIT2

OH 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 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.

Share this post


Link to post
Share on other sites

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.


Share this post


Link to post
Share on other sites

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.

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.

Share this post


Link to post
Share on other sites

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.


Share this post


Link to post
Share on other sites

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 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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@Jabberwock

Please 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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...