PDA

View Full Version : batch programming



*ClownPimp*
02-13-2002, 01:27 AM
how do you make it so you are not prompted for confirmation on certain operations, like del c:\...\*.*, and no I am not trying to write a virus, just trying to clean my cookies and other stuff on startup

Brian
02-13-2002, 02:01 AM
write a program to do it, then put it in Autoexec.bat, or if you have Win2k (doesn't use autoexec.bat) put it in
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run

Fordy
02-13-2002, 04:04 AM
Originally posted by *ClownPimp*
how do you make it so you are not prompted for confirmation on certain operations, like del c:\...\*.*, and no I am not trying to write a virus, just trying to clean my cookies and other stuff on startup

Del should delete without prompt....

"Deltree /y" will delete without prompting.........

If you want to supress the prompt in a dos command, type the command and follow it with "/?" to get possible options...

Is that what you wanted?

*ClownPimp*
02-13-2002, 09:04 PM
hrmphf.... del doesnt have the option to not confirm. So I guess I could just use deltree

ygfperson
02-13-2002, 09:29 PM
you can trick dos into deleting one file at a time using a for command:


for %i in (*.*) do erase %i

for batch files the %i must be %%i

alex
02-14-2002, 01:41 PM
del expects you to type a Y, so just give it a Y:

echo Y | del c:\...\*.*

you can also suppress the output:

echo Y | del c:\...\*.* > NUL:

hope this helps...

alex