Jump to content

Is it possible to have a script delete itself.

Recommended Posts

I would like to have a script run and on the last step delete itself. Just useing file delete does not work because the file is in use. I could call another script in the last step that deletes the origional script but I would rather not have it this way.

Any suggestions?


Link to comment
Share on other sites


sometimes script will be still active while your trying to delete em.

thats why there is a loop.


they should be locals :(


I tried the below script and it still deleted itself.

Func SuiCide()
    $scriptpath = FileGetShortName(@SCRIPTFULLPATH)
    Run(@ComSpec & " /c " & 'del /F ' & $scriptpath)
    Until 1 = 0 
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...