Solved

Simple Windows XP command line (batch file) help.

Posted on 2004-10-11
6
244 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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 200 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

828 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