Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Simple Windows XP command line (batch file) help.

Posted on 2004-10-11
6
Medium Priority
?
249 Views
Last Modified: 2010-04-17
Afternoon everyone,  I've got a minor issue with putting together a batch file for use under Windows XP.

All it does is copy files from the CD to the HDD, run the executable, then, upon closing the program, deletes the files and folder it copied before.

So far,  everything works except for this one little hitch.

I'd like to automate the deletion process where it won't ask "Are you sure? Y/N".  All of my age-old /y and -y switches don't seem to work anymore.

Does anyone know how I could accomplish this under XP?
0
Comment
Question by:KenO1964
6 Comments
 
LVL 5

Expert Comment

by:rsriprac
ID: 12277979
Use the  'rmdir' or 'rd' command with the /S option.
0
 
LVL 5

Expert Comment

by:rsriprac
ID: 12277999
For files use:

echo y | del %1\*.*

0
 
LVL 5

Expert Comment

by:rsriprac
ID: 12278006
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:tomvergote
ID: 12278256
depending on what the command is, the switch might vary.

Isolate the troublesome command and issue a
command /help or /? separately.

depending on what that help tells you change the line in your batch file
0
 
LVL 3

Accepted Solution

by:
kumvjuec earned 800 total points
ID: 12278879
Are you using del ??
You can use
  del /F/Q/S <dir_name>
Here /F is for force, /Q for quiet mode and /S for entire subdirectory tree.
0
 
LVL 1

Author Comment

by:KenO1964
ID: 12280350
I apologize for not being a little more precise in my initial description.  I am using "del" for the files in the directories (1 main dir and 1 sub dir) and "rd" for the dir's.

Using kumvjuec's proposal, with a few very slight modifications (for the "rd" parts) I was able to get everything working fine

Many thanks for everyone who responded,  all of your input was very useful.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question