Hah, good old dos. Try redirecting all output intended for the console
with:
CTTY nul
before you del a folder. Restore the console with
CTTY con
You must restore the console before the batch file exits. Otherwise you get
very erratic and bad results. CTTY shuts down the keyboard as well as the
display so there is no way to restore the console if your batch file exits
to a dos prompt and you haven't issued the CTTY con command. Anyway, since
the console is the default error message destination, once console is
pointed to nul, no messages will display. After your sure there will be no
more messages, restore the console to point to the dos device name CON.
Don't ever issue the CTTY command from a dos prompt unless there is a
legitimate input device your pointing toward. CTTY COM1 will work if you
are using a telnet connection over a modem from another pc and your modem is
on com1. The other pc will gain control of your dos prompt. When he issues
ctty con your display and keyboard will be restored.
I used a different method once, but I can't remember it.
Tom Turak
-----Original Message-----
From: Stephen Lo [mailto:[log in to unmask]]
Sent: Thursday, January 10, 2002 10:47 PM
I use the following lines in a batch file to delete all files in a folder:
@echo off
Echo Y| del c:\temp\*.* > Nul
IF folder 'temp' is empty a line "file not found" returns. How could I
eliminate this feedback?
THank you!!
PCSOFT maintains many useful files for download
visit our download web page at:
http://freepctech.com/downloads.shtml
|