Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Jan 03, 2005 5:06 am Post subject: Delete your own exe after use |
|
|
Little example showing how to use a small batch file to delete your own
exe after it's done, and also delete the bat file itself. Great for installation
routines.
Code: | DIALOG CREATE,Self Kill,-1,0,240,59
DIALOG ADD,BUTTON,BUTTON1,19,24,193,24,Kill my own exe now!
DIALOG SHOW
WAIT EVENT
LIST CREATE,1
LIST ADD,1,:BEGIN
LIST ADD,1,DEL @shortname(%0)
LIST ADD,1,IF EXIST @shortname(%0) GOTO BEGIN
LIST ADD,1,DEL @shortname(@path(%0))killme.bat
LIST SAVEFILE,1,@path(%0)killme.bat
LIST CLOSE,1
RUNH @shortname(@path(%0))killme.bat
EXIT |
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
vtol Valued Contributor
Joined: 05 Feb 2004 Posts: 642 Location: Eastern Indiana
|
Posted: Mon Jan 03, 2005 2:10 pm Post subject: |
|
|
awesome
I been doing that for a long time, but I had to use the CALL in my batch file, to call another one.
Your way is much nicer and less headache...
Thanks Garrett (I'll use it somedays I'm sure) |
|