Jump to content

Recommended Posts

Posted

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?

Thanks

Posted

Thanks! Works great I had to make some slight modifications since it will be running on win9x machines.

$scriptpath=GetShortName(@SCRIPTFULLPATH)

and of course replace @SCRIPTFULLPATH with $scriptpath

Posted

This worked for me:

SuiCide()
Func SuiCide()
    $scriptpath = FileGetShortName(@SCRIPTFULLPATH)
    Run(@ComSpec & " /c " & 'del /F ' & $scriptpath)
    Exit
EndFunc
Posted

@MARK

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

thats why there is a loop.

@LARRY

they should be locals :(

<{POST_SNAPBACK}>

I tried the below script and it still deleted itself.

SuiCide()
Func SuiCide()
    $scriptpath = FileGetShortName(@SCRIPTFULLPATH)
    Run(@ComSpec & " /c " & 'del /F ' & $scriptpath)
    Do
        Sleep(1000)
    Until 1 = 0 
EndFunc

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