Solved

Simple Windows XP command line (batch file) help.

Posted on 2004-10-11
6
241 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
Comment Utility
Use the  'rmdir' or 'rd' command with the /S option.
0
 
LVL 5

Expert Comment

by:rsriprac
Comment Utility
For files use:

echo y | del %1\*.*

0
 
LVL 5

Expert Comment

by:rsriprac
Comment Utility
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 8

Expert Comment

by:tomvergote
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Windows 10 SmartScreen vs ClickOnce app 5 132
scoreUp challenge 14 48
How does Google get such fast response times? 5 120
Path to Python 9 37
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
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.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now