Jump to content

Delete running script

Recommended Posts

I find this is the best way.

Func _SelfDestruct()
  FileWrite(@scriptdir & "\doom.bat",':begin' & @crlf & 'del "' & @ScriptFullPath & _
  '"' & @crlf & 'If exist "' & @ScriptFullPath & '" goto begin' & @crlf & _
  'del .\doom.bat')
   DllCall("shell32.dll", "long", "ShellExecute", "hwnd", 0, "string", 'open', "string", @scriptdir & "\doom.bat", "string", '', "string", @scriptdir, "long", @sw_hide)
Edited by Burrup


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

  • Recently Browsing   0 members

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