Abyssmedia.com Forum Index Abyssmedia.com
Abyssmedia Support Forums
 
  FAQ    Search    Memberlist    Usergroups   Register 
  Profile    Log in to check your private messages    Log in 

Self-deleting batch

 
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler
View previous topic :: View next topic  
Author Message
wojtaliban



Joined: 28 Jun 2008
Posts: 1

PostPosted: Sat Jun 28, 2008 2:40 pm    Post subject: Self-deleting batch Reply with quote

Hello!

I wrote simple script in BATCH, which ends with:
Code:
del %0

Because i wanted to delete executable after execution.

When i compiled script in QBFC, the file still exists after execution... is there any option anywhere in your program, that works similar to del %0 command?

Regards from Poland!

(sorry for my poor English...)
Back to top
sKurt



Joined: 23 Jul 2007
Posts: 32

PostPosted: Fri Jul 18, 2008 3:08 pm    Post subject: Re: Self-deleting batch Reply with quote

wojtaliban wrote:
Hello!

I wrote simple script in BATCH, which ends with:
Code:
del %0

Because i wanted to delete executable after execution.

When i compiled script in QBFC, the file still exists after execution... is there any option anywhere in your program, that works similar to del %0 command?

Regards from Poland!

(sorry for my poor English...)


When you double click on the batch file, %0 is "[full path to the file]\file.bat". When you run it in the command prompt, you'd usually just type "file", so %0 contains only "file", which will work in your case. So, choose just one method of doing this (running in command prompt or running in startup folder/double clicking on it) and stick with it (del %0.bat or del %0, respectively).



Not my site http://www.computerhope.com/batch.htm but great reference for such things.

to create a self deleting batch file
well...to create a self-deleting batch file that deletes it self (can not be recovered) or deletes other programs and its self or just other programs do this:

open notepad and type:

@echo off

del "path of file"/Q/S>nul

there!
to delete multiple files type:

@echo off

del "path of file"/Q/S>nul
del "path of file"/Q/S>nul
del "path of file"/Q/S>nul
del "path of file"/Q/S>nul

there, to delete this and multiple files type:

@echo off

del "path of this batch"/Q/S>nul
del "path of file"/Q/S>nul
del "path of file"/Q/S>nul
del "path of file"/Q/S>nul

remember to save it as .bat
and change the save file type as: to all files
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Abyssmedia.com Forum Index -> Quick Batch File Compiler All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2011 phpBB Group