Computing.Net > Forums > Windows 2000 > Reading input from a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Reading input from a batch file

Reply to Message Icon

Name: Sumanth Sharma
Date: September 9, 2003 at 21:32:04 Pacific
OS: Windows 2000 Professional
CPU/Ram: P IV 2.4GHz / 512MB
Comment:

How do I input a value using a batch file.

For example, In perl i would say

$input = ;
similairly in a unix shell scrips I will say

read input;

MY QUESTION IS HOW TO ACHIEVE THIS IN MS-DOS
BATCH FILE?

HOPE TO GET SOMETHING FROM U'R EXPERTISE.



Sponsored Link
Ads by Google

Response Number 1
Name: Matt
Date: September 10, 2003 at 05:50:31 Pacific
Reply:

Step 1> Turn off your CAPS please - thank you!

Step 2> For a batch file, input has to be given at command line, and stored as an environment variable. Unless there are new batch file rules that I'm not aware of that is.

What exactly are you trying to accomplish? That will help me understand this and help you a bit better. Thanks!


0

Response Number 2
Name: Sumanth Sharma
Date: September 10, 2003 at 06:09:21 Pacific
Reply:

Say, in a batch file I want to invoke a perl script. But before this I wan't to ask the
THANKS FOR REPLYING, AND THANKS IN ADVANCE IF U REPLY FOR THIS

user something like
"are you sure u want to run this script, which will delete all your temporary internet files Y/N"

NOW FROM THIS POINT ON, I WAN'T TO TAKE AN INPUT YES OR NO FROM THE USER, HOW DO I ACCOMPLISH IT IN A BATCH FILE



0

Response Number 3
Name: Sumanth Sharma
Date: September 10, 2003 at 06:11:10 Pacific
Reply:

Error in my last reply. Ignore it.

THANKS FOR REPLYING, AND THANKS IN ADVANCE IF U REPLY FOR THIS

Say, in a batch file I want to invoke a perl script. But before this I wan't to ask the
user something like
"are you sure u want to run this script, which will delete all your temporary internet files Y/N"

NOW FROM THIS POINT ON, I WAN'T TO TAKE AN INPUT YES OR NO FROM THE USER, HOW DO I ACCOMPLISH IT IN A BATCH FILE



0

Response Number 4
Name: Matt
Date: September 10, 2003 at 06:25:31 Pacific
Reply:

Are you familiar with the Choice command and error levels? Very easy to use really - some resources below:

http://www.computerhope.com/choicehl.htm

http://www.computerhope.com/batch.htm


0

Response Number 5
Name: Sumanth Sharma
Date: September 10, 2003 at 06:47:48 Pacific
Reply:

But mine is a NT 5.0 Machine( Windows 2000 )
CHOICE command is not available boss.
Pls help me out.


0

Related Posts

See More



Response Number 6
Name: Matt
Date: September 10, 2003 at 06:56:08 Pacific
Reply:

Google is your friend:

http://www.computing.net/windows2000/wwwboard/forum/49954.html


0

Response Number 7
Name: Sumanth Sharma
Date: September 10, 2003 at 21:20:03 Pacific
Reply:

Thankx a lot Matt. The link u sent last time's really got some good stuff for me.

Thanks a lot again.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: Reading input from a batch file

Need to read a text file from a batch file www.computing.net/answers/windows-2000/need-to-read-a-text-file-from-a-batch-file/65828.html

Win2000 and XP variable from a text file www.computing.net/answers/windows-2000/win2000-and-xp-variable-from-a-text-file/35180.html

Create a Batch file www.computing.net/answers/windows-2000/create-a-batch-file/49745.html