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
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?
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
Response Number 6
Name: Matt Date: September 10, 2003 at 06:56:08 Pacific
Summary: Hi, I would like to read text file e.g. abc.txt from batch file. There will be only one line in abc.txt file as given below... InstallationPath REG_SZ C:\Program Files\XYZ\My SoftwarePath\ I wo...
Summary: need to know which env variable. You can write a batch file in notepad by just naming the file whatever.bat and including the lines to set the environment variable of your choice. i.e. @echo off *//w...
Summary: Can anyone tell me how would I create a batch file to pull files from an internet site. The file instance name changes weekly in numeric order. i.e. 2221.exe, next batch run I want to pull 2222.exe ...