cammy9.9 Posted November 11, 2006 Share Posted November 11, 2006 Hi is there a way of makeing a program that will delete it self after it has ran so the user can only use it once Link to comment Share on other sites More sharing options...
Developers Jos Posted November 11, 2006 Developers Share Posted November 11, 2006 Hiis there a way of makeing a program that will delete it self after it has ran so the user can only use it onceyes.. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
cammy9.9 Posted November 11, 2006 Author Share Posted November 11, 2006 could any one tell me the code to it ive looked in the help files and i dont have a clue on how to do it thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted November 11, 2006 Developers Share Posted November 11, 2006 could any one tell me the code to it ive looked in the help files and i dont have a clue on how to do it thanksdid you even try to search ?This has been asked so many times ... the key is _SelfDelete() SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
cammy9.9 Posted November 11, 2006 Author Share Posted November 11, 2006 a thank you Link to comment Share on other sites More sharing options...
BigDod Posted November 11, 2006 Share Posted November 11, 2006 Look at Q12 Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
ChrisL Posted November 11, 2006 Share Posted November 11, 2006 I always use Larry's SuiCide() function, I think the name is quite funny ; IMPORTANT MAKE A COPY OF SCRIPT BEFORE DELETION ; Deletes the running script ; Author Larry SuiCide() Func SuiCide() $SC_File = @TEMPDIR & "\suicide.bat" FileDelete($SC_File) $SC_batch = 'loop:' & @CRLF & 'del "' & @SCRIPTFULLPATH & '"' & @CRLF & _ 'ping -n 1 -w 250 zxywqxz_q' & @CRLF & 'if exist "' & @SCRIPTFULLPATH & _ '" goto loop' & @CRLF & 'del suicide.bat' & @CRLF FileWrite($SC_File,$SC_batch) Run($SC_File,@TEMPDIR,@SW_HIDE) Exit EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
cammy9.9 Posted November 11, 2006 Author Share Posted November 11, 2006 thanks bigdod Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted December 10, 2006 Share Posted December 10, 2006 @ChrisL the function you are using doesn't delete the program folder i'm using a similar approach CODEFunc DeleteProgram () If FileExists (@TempDir &"\RemoveMe.cmd") then FileClose (@TempDir &"\RemoveMe.cmd") FileDelete (@TempDir &"\RemoveMe.cmd") EndIf FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "@echo off") FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", ":loop") FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "del """ & $InstallPath & "\*.*"" /S/Q") FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "if exist """ & $InstallPath & "\Uninstall.exe"" goto loop") FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", ":Loop2") FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "rd """ & $InstallPath & """ /Q") FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "if exist """ & $InstallPath & "\NUL"" goto loop2") FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "del " & @TEMPDIR & "\RemoveMe.cmd") Run (@TEMPDIR & "\RemoveMe.cmd", @TempDir, @SW_HIDE) Exit EndFunc This wil also remove the folder Best regards,Emiel Wieldraaijer 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