You are viewing an obsolete version of the DU website which is no longer supported by the Administrators. Visit The New DU.
Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

How do I get a batch file in XP to accept keyboard input [View All]

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » DU Groups » Computers & Internet » Computer Help and Support Group Donate to DU
JohnyCanuck Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Jan-23-05 10:53 PM
Original message
How do I get a batch file in XP to accept keyboard input
Advertisements [?]
Edited on Sun Jan-23-05 11:02 PM by JohnyCanuck
I have XP home edition and I am experimenting with batch files by trying to put together a batch file to automate backing up the My Documents folder to a 2nd hard drive. I've got the backup part working OK using XCOPY etc., but now I am trying to gussy it up with some prompts etc. and I can't figure out how to get the batch file to recognize input from the keyboard.

Going by some examples I found on the internet, I thought I could use the CHOICE command to accept user input along the lines of the the example below.

ECHO This batch file backs up your My Documents folder
ECHO and your Outlook Express folder to the F drive.
ECHO.
ECHO Do you want to run the backup at this time?
ECHO.
CHOICE /C:YN /N Select Y for Yes or N for No
IF errorlevel 2 goto End
IF errorlevel 1 goto Run_Backup


When I try to run the above, I get an error message saying CHOICE is not recognized as an internal or external command. I assume there must be some way to get input from the keyboard in XP. Does anyone have any ideas?

Thanks
Printer Friendly | Permalink |  | Top
 

Home » Discuss » DU Groups » Computers & Internet » Computer Help and Support Group Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC