Nukex1 Posted June 26, 2008 Share Posted June 26, 2008 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 Link to comment Share on other sites More sharing options...
monoceres Posted June 26, 2008 Share Posted June 26, 2008 http://www.autoitscript.com/forum/index.php?showtopic=37289Q12 Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Nukex1 Posted June 26, 2008 Author Share Posted June 26, 2008 I got no idea how to use it Link to comment Share on other sites More sharing options...
monoceres Posted June 26, 2008 Share Posted June 26, 2008 I got no idea how to use itJust 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! Link to comment Share on other sites More sharing options...
Nukex1 Posted June 27, 2008 Author Share Posted June 27, 2008 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) Link to comment Share on other sites More sharing options...
monoceres Posted June 27, 2008 Share Posted June 27, 2008 (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 June 27, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Nukex1 Posted June 27, 2008 Author Share Posted June 27, 2008 (edited) wow thx mate xD ur awesome!!! I have been trying to figure this out all day 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 June 27, 2008 by Nukex1 Link to comment Share on other sites More sharing options...
Anonymouse Posted June 27, 2008 Share Posted June 27, 2008 wow thx mate xD ur awesome!!!I have been trying to figure this out all day 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 selfas 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. :) Link to comment Share on other sites More sharing options...
Nukex1 Posted June 27, 2008 Author Share Posted June 27, 2008 (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 June 27, 2008 by Nukex1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now