I am writing a batch file that will be run from a DVD to copy some necessary files to a location specified by the user.

225 pts.
Tags:
Batch
Batch files
DOS
Microsoft Windows 7
Scripting languages
Windows Batch Files
I am writing a batch file that will be run from a DVD to copy some necessary files to a location specified by the user. I have used switches to get Yes or No input in the past. How do I get a drive location from the user and then verify that on the current system so I can return an error echo?

 Also, is there a way to show progress or a time elapsed/estimated output?



Software/Hardware used:
Windows 7

Answer Wiki

Thanks. We'll let you know when a new response is added.

See you have 2 questions

<i><b>How do I get a drive location from the user and then verify that on the current system so I can return an error echo?</b></i>
Ans. Try “IF EXIST”. I use it to check the existence of the drive/folder/file. I can’t remember all sentence but you can explore from here > http://users.cybercity.dk/~bse26236/batutil/help/IF_E.HTM

How to prompt for and capture input within CMD script without additional utilities:
———
:ASK
ECHO Message about what you are looking for
set /p MyValue=
REM Error Handler for blank input
IF “%MyValue%”==”” goto :ASK
——–

<i><b>Also, is there a way to show progress or a time elapsed/estimated output?</b></i>
Ans. Use ROBOCOPY to copy the files and you can present a progress on screen as well as logging the results.

Hope these help.

These help allot!
Thank you.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following