visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Operating Systems :: DOS :: How to get input for an executable from batch file?


By: progGoon U.S.A.  Date: 04/02/2003 00:00:00  English  Points: 50 Status: Answered
Quality : Excellent
Hi,
I know very primitive shell scripting for windows. And i m working with windows NT. I have an executable which asks for input during processing unlike command line arguments. I need to write a batch file for runnning this executable for few dozen times. Plz tell me:
1. how to get input at prompt by process.
2. is it also possible to enter an alternate input by having checking of some sort.
3. Any good tutorial on-line abt this stuff.
Thanks,
progGoon
By: sumotimor Date: 05/02/2003 21:56:00 English  Type : Answer
1. Use the smaller-than (<) sign and then the text with input.
E.g. comfile.exe <argument1.txt.
The argumentfile will be read one line at a time whenever the app needs it.
2. Depends on the checking. A more powerful alternative for batchfiles would be Kixtart, freely downloadable from the MS website.
3. Dunno for normal batch, but Kixtart comes with extensive manuals and tutorial.

Have fun,

sumotimor
By: progGoon Date: 05/02/2003 22:19:00 English  Type : Comment
Hi,
Can anyone plz tell me wat %1, %2 or variable in between %s means and how to use them. Basically how to use varibles in shell scripting?
Thanks,
progGoon
By: VGR Date: 05/02/2003 22:37:00 English  Type : Assist
they are the arguments passed on the command-line, in order, and separated by space(s)

technically, %0 is the name if the executable itself (BAT, COM, EXE)

c:\mybatch.bat filename1.txt process debug

will produce in the batch itself :
%1=filename.txt
%2=process
%3=debug

I think that values containing space(s) but enclosed in double quotes are treated as a single parameter's value

Do register to be able to answer

EContact
browser fav
page generated in 333.423850 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page