DOS help

Status
Not open for further replies.

jcortes

Fully Optimized
Messages
1,909
hey i was making a bat file and i was wondering if there is any way to automaticaly say yes to a condition like the DEL command.
 
add /y to the end, or for example:

deltree c:\windows\temp\*.* /y

if this is a problem then use echo, for example:

echo y | del %1\*.*

well, back to work
 
wait im confused i want to make a file that will delete some corrupt files from a directory and i want to put it in that directory so wen i run it it deletes the files in that directory and i want it to not ask me if im sure i want to delete. also i dont have the deltree command on my comp so what do i do.
 
hmmmmm use arguments

batch file named cleanup.bat

del %1 /q

:eof

use wild card when running this file, cleanup C:\temp\*.*

the /q switch suppresses any are you sure prompts for wildcard deletions


instead of deltree, rmdir should be used

Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S
 
Status
Not open for further replies.
Back
Top Bottom