I have put the following command in a batch file
del *.*
This command when the batch file reaches it requires a "Y" to continue
Could you please remind me how to make the command continue without the "Y"
entry
Thanking you in advance
--
Find everything you need at: http://www.home-it.com
2) Deleting all files without being prompted "Are you sure (Y/N)?"
168498 Sep 22 2000 ftp://garbo.uwasa.fi/pc/ts/tsbat62.zip
tsbat62.zip A collection of useful batch files and tricks, T.Salmi
All the best, Timo
--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html
It's a really bad idea to remove the /Y prompting from this as it
stands, because if you do, the batch becomes a wipe-directory for
any current directory it's executed in - including deleting
itself if it's there! If you run DONTDOIT.BAT with this command
as you ask for it, you'll see something like this output:
C:\WORK\TEST>DONTDOIT
All files in directory will be deleted!
Are you sure (Y/N)?y
Batch file missing
Oops! Goodbye batch and everything else. The feature you want
is ECHO Y | (| =pipe command) to send the (Y)es to the command.
Consider something like:
ECHO Y | DEL C:\specific\path\name\*.* >NUL
(the >NUL silences the waring and over-ride y report). If you
don't do it this way, you'll probably eventually regret not doing
so.
--
William Allen
Timo, I do appreciate your response too although I prefer not to download
programs from websites to find an answer..
--
Find everything you need at: http://www.home-it.com
"William Allen" <ma...@mayfly13.fsnet.co.uk> wrote in message
If you have any interest to learn batch file commands, I highly recommend
that you download Timo's zipped list of FAQ's etc. which include the replies
found here.
--
Todd Vargo (body of msg must contain my name to reply)
> Please excuse this silly post, I do not use batch programming very often and
> I forgot how this is done.
>
> I have put the following command in a batch file
>
> del *.*
>
> This command when the batch file reaches it requires a "Y" to continue
> Could you please remind me how to make the command continue without the "Y"
> entry
>
> Thanking you in advance
>
> --
> Find everything you need at: http://www.home-it.com
(Command Line)
FOR %F IN (*.*) DO DEL %F
(in Batch File)
FOR %%F IN (*.*) DO DEL %F%
James Coons
-------------------------^^^ !!should be %%F
In DOS7;
FOR %%F IN (*.*) DO DEL %%F
Works on both the cmd line and in a batch.
DOS5 won't allow this, I don't know about DOS6...
Bye
L
>James Coons
>
In 6.22, one % at the command line and two % in a batch.
--
Outsider
MS-DOS 6.22, Windows for Workgroups 3.11, Netscape Navigator 4.08
echo y | del *.* >NUL
This way you won't have to enter Y, and you won't see the 'Are you sure'
text on your screen. This command will just clean a directory without
writing anything on the screen and without asking you questions.
I hope this will be of help, Erik Hegeman.
James A. Coons <jac...@ameritech.net> schreef in berichtnieuws
3A025C4C...@ameritech.net...
(my mistake - type. Command Line is %F and batch file is %%F.
James Coons
> (my mistake - type. Command Line is %F and batch file is %%F.
>
> James Coons
>
Actually I wonder just how they have implemented this; the major
change in DOS7 interactive mode of parsing the command line
for variables is syntactically ambiguous if you still allow
a single % to represent replaceable parameters.
The way the line is parsed is really weird;
FOR %P IN (1) DO ECHO %PATH%P
ECHO's the variable %PATH% followed by a 'P'
FOR %P IN (1) DO ECHO %PATH_%P
ECHO's "1ATH_1"
There are lots of complications to this,
I bet the code for DOS7 is absolutely hideous....
Bye,
L