Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Simple Windows XP command line (batch file) help.

Posted on 2004-10-11
6
Medium Priority
?
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Progress

730 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