Sign in to follow this  
Followers 0
Nukex1

delete it self

9 posts in this topic

so my program is almost done...

the only thing I need is to make it delete it self after one use

or atleast make it unable to work again

FileDelete ( "path" )

thats what I found in help file but I got no idea how to make it work

if I write the path its not going to work because it might not be there anymore

its a program im going to give to others when they use it

it will delete before restarting computer or just when its closing

ANYTHING TO MAKE THEM NOT BE ABLE TO USE IT AGAIN

Share this post


Link to post
Share on other sites



I got no idea how to use it

Share this post


Link to post
Share on other sites

I got no idea how to use it

Just copy it into your script, then call the function before your script is about to exit..


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

the thing is... my script never exits thats why I want to do it when computer starts or closes

(basicly the user is forced to close his computer)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Just add this to your script:

Func OnAutoItExit()

    Local $sCmdFile, $iDelay=0
    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
Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

wow thx mate :P xD ur awesome!!!

I have been trying to figure this out all day :P

finally my script/program is done ^^ >Nuke is happy<

*edit*

dangit...

so the script is working fine and it does delete it self IF you get to close it your self (which you dont get to do = blockinput(1))

when I restart or close my computer the script doesnt get to delete it self

as if the computer close too fast :)

Edited by Nukex1

Share this post


Link to post
Share on other sites

wow thx mate :P xD ur awesome!!!

I have been trying to figure this out all day :P

finally my script/program is done ^^ >Nuke is happy<

*edit*

dangit...

so the script is working fine and it does delete it self IF you get to close it your self (which you dont get to do = blockinput(1))

when I restart or close my computer the script doesnt get to delete it self

as if the computer close too fast :)

Why don't you add another script to startup then that deletes both of them at startup?

And I'm not even going to ask what your script does.


children may smile; the wise ponder- Dr. Holmes of Hardvard Medical School on an Ether BingeLove Makes The World Go Round?So does five shots of tequila. What's your point?[quote name='Valik' date='Jun 5 2008, 05:13 PM']wraithdu, 24 hours. Said I have a bad attitude, just driving the point home with a ban.[/quote]This is classic. :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

wow now I have to find out how to make a program start with startup

and then how to delete them both xD

good luck to me thx to you both

Edited by Nukex1

Share this post


Link to post
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
Sign in to follow this  
Followers 0