Discussion Locked

batch file to delete a subdirectory

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I currently have a piece of proprietary software that has a flaw in it. If the computer freezes while in the software, we need to delete a subdirectory named restart. When the program is running there are files in the subdirectory, but when the progam is closed there are no files in this subdirectory although the folder is there.
I haven't done this type of batch file in forever, how can I write it up to make this an automated task so that the users don't have to do more than click on an icon.

Thanks,
tracarts

9 replies

by johngreer

How about a two line BAT file, called from AUTOEXEC.BAT:

WINZIP -mp SaveRestart.zip restart\*.*
ERASE SaveRestart.zip

Assuming you own WinZip!

by tech_wiz03

Another way...
make a simple batch program called
fixrestart.bat in this file put a simple one liner
erase *.*

where:
if you wanted to erase c:\program1\restart\*.*
that is what the line would say.

then open in Mycomputer where you stored the batch file and rightclick the batchfile and choose send to desktop as shortcut. Now your opperators can click the shortcut on the desktop anytime the folder needs to be cleared.

regards
rick

by jeff

rm c:\PATH\restart

type this is notepad (where c:\PATH is the path to the folder)
and save it as remove.bat
then all they need to do is double click the batch file.

by tracarts

Poster rated this answer.
Thank you, I think this is the simplest solution. And very elegant. I appreciate the help.

This discussion is closed to new replies.