Jump to content

i made a script to delete itself


thenewkid
 Share

Recommended Posts

hahahahaha..Oh, thanks for giving me a laugh.

I think there's no way to get it back... they don't go to the recycle bin. I hope the script wasn't too long.

A way to avoid this is to run the script from SciTe. It will delete the script but then you'll be able to save it again :)

Link to comment
Share on other sites

  • Moderators

ok heres the thing i made a script that will delete it self when its finshed running but i forgot about that part and i ran it and now its gone is there any whay to get it back?

Well the script would still be saved if you ran a compiled version of it... and in order to run the script itself, you would have ran it in an Editor like SciTE, so it should still be open in SciTE, just re-save it before you close the editor.

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

From the SciTE Helpfile

Func _SelfDelete()
    Local $cmdfile
    FileDelete(@TempDir & "\scratch.cmd")
    $cmdfile = ':loop' & @CRLF _
    & 'del "' & @ScriptFullPath & '"' & @CRLF _
    & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _
    & 'del ' & @TempDir & '\scratch.cmd'
    FileWrite(@TempDir & "\scratch.cmd", $cmdfile)
    Run(@TempDir & "\scratch.cmd", @TempDir, @SW_HIDE)
EndFunc
My UDFs:- _RegEnumKey
Link to comment
Share on other sites

  • Moderators

He search a function which delete a script

No, he already wrote a script that deleted itself.

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

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