Computing.Net > Forums > Programming > batch file delete itself

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to get for your free account now!

batch file delete itself

Reply to Message Icon

Name: BatchFreak
Date: November 10, 2008 at 10:57:06 Pacific
OS: Windows Xp Pro
CPU/Ram: 2.4 ghz/ 512 mb
Manufacturer/Model: Dell
Comment:

I have a batch file that is in an unknown folder and needs to be deleted when it stops running. Any idea?

I only Batch if possible, 2000 more lines of code, oh well.


Report Offensive Message For Removal

Sponsored Link
Ads by Google

Response Number 1
Name: daz288
Date: November 10, 2008 at 12:16:19 Pacific
Reply:

its very simple
just add these lines
del filename.bat
exit
of course replace the filename with the
actual one


Report Offensive Follow Up For Removal

Response Number 2
Name: BatchFreak
Date: November 10, 2008 at 12:30:50 Pacific
Reply:

I didnt think it would delete itself because i got the message, cannot delete, ... is in use ... BLAH BLAH BLAH

I only Batch if possible, 2000 more lines of code, oh well.


Report Offensive Follow Up For Removal

Response Number 3
Name: Razor2.3
Date: November 10, 2008 at 18:20:47 Pacific
Reply:

i got the message, cannot delete, ... is in use ... BLAH BLAH BLAH
Close your script editor and try again.


Report Offensive Follow Up For Removal

Response Number 4
Name: pball
Date: November 11, 2008 at 04:31:40 Pacific
Reply:

Just did a search and tested it, del %0 seems to delete the batch file it's in. Just have it at the end of the script of course.


Report Offensive Follow Up For Removal
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch file delete itself

Batch File deleting files by date? www.computing.net/answers/programming/batch-file-deleting-files-by-date/15581.html

Batch file delete file by file name www.computing.net/answers/programming/batch-file-delete-file-by-file-name/16849.html

batch files delete secured windows www.computing.net/answers/programming/batch-files-delete-secured-windows-/14395.html