Jump to content

Delete file upon exit?


Recommended Posts

  • Moderators

Is there a way to delete a file upon exit?

I wrote a custom installer/uninstaller and well if you run the uninstall it will delete the setup's files but not the uninstaller since it is currently running.

Look at OnAutoItExit()

If you're talking about deleting the actual .exe/.au3 your using on their puter, open SciTe and type in:

SelfDelete[space]

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

  • Moderators

dosn't work

sucks to be you doesn't it.

(that sucks to see that.. doesn't it!!)

(if you want to see more, then post an example script that you want to see something happen (in detail))

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

  • Moderators

lol, bud, umm, you may want to help me but you must have some thing wrong here, some thing you're not telling me, i'm running the latest beta (to my knowledge) and typed it at the VERY end of the func that was executed.."SelfDelete " <----YES a space

Try reading "Exactly" what I said.. or are you someone that needs step by step how to screw yourself examples?

1. Open SciTe Editor

2. Type SelfDelete

3. Hit the space bar

4. Poof!

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

  • Moderators

For you...Once you're done viewing lemmie know, i don't want to waste bandwidth....

http://www.team-nex.net/whatnow.avi

For the MORONS
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
IS WHAT HAPPENS WHEN YOU FOLLOW MY POST.

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

  • Moderators

fuck you

No problem punk... you're mad why? Because you can't follow instructions? Right!!

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

  • Moderators

i showed you a god damn video of your "instructions" Was my movie not good enough for you?

DO YOU HONESTLY THINK ANYONE IS GOING TO DOWNLOAD ANYTHING FROM ANYONE THAT ASK QUESTIONS LIKE YOU DO?

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

  • Moderators

you seem pissed, rofl, your just mad it dosn't exist and your wrong

if it didn't exist, then you wouldn't see the function that i posted above... care to make yourself look anymore the idot?

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

  • Moderators

Show me a script of this actually SELF DELETING

wtf is your problem!

Ok...

Name a script... IAmAMoron.au3... then in that scipt type

MsgBox(64, 'World Info:', 'Yes Jabba da whatever the hell his name is a moron')

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

Mpw save it to your desktop... .. Now run it... now look at your desktop... is it still there? Right!!

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.

Link to comment
Share on other sites

  • Moderators

Yes, infact it is still THERE, do i need to make another video?

Nah.. make yourself dissapear, I'll wait around until that miracle happens.

Don't need to see what video you need to run, I gave you the exact script, now you've crossed form moron to idiot status.

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

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


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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...