Please Help me,
I use interactive qbasic prog5.exe that after starting (the win_xp) requirements six times data input via keyboard. After that, do its job and prints text and diagram on the screen. Please help to make Start5.bat command that would be accomplished automatically with the prepared data into text*.txt files located on the C: drive.
I apologize for my poor English use- ogle translator
thank you
my idea?
Start5.bat
C: \ PROG5.EXE '' contents of files
<TYPE TEXT1.TXT '' text1 = "FX1"?
<TYPE TEXT2.TXT '' text2 = "C:\CMK15.TXT"
<TYPE TEXT3.TXT '' text3 = "YX3"
<TYPE TEXT4.TXT '' text4 = "YX4"
<TYPE TEXT5.TXT '' TEXT5 = "12"
<TYPE TEXT6.TXT '' TEXT6 = "ENGINESTARTER"
prog2.bat controls the external prog1.exe
Moderator: DosItHelp
Re: prog2.bat controls the external prog1.exe
The solution depends on the program. Some allow redirection and piping of text and others don't.
Code: Select all
@echo off
(
echo FX1
echo C:\CMK15.TXT
echo YX3
echo YX4
echo 12
echo ENGINESTARTER
)|PROG5.EXE
-
- Posts: 3
- Joined: 25 Jan 2014 17:33
Re: prog2.bat controls the external prog1.exe
foxidrive wrote:The solution depends on the program. Some allow redirection and piping of text and others don't.Code: Select all
@echo off
(
echo FX1
echo C:\CMK15.TXT
echo YX3
echo YX4
echo 12
echo ENGINESTARTER
)|PROG5.EXE
I started this prog.bat but prog5.exe did not collect data FX1,..,.. from echo commands. The first thing it asked for, was to re-input via the keyboard. There is no change, it remains the same, like I directly started prog5.exe.
Is there any chance to automate it over prog.bat command.
thank you
regards
Re: prog2.bat controls the external prog1.exe
You can try this but it may be the same. This assumes that you don't have any poison characters in your input data like & ) % etc.
Another option is an AutoIt script.
Another option is an AutoIt script.
Code: Select all
@echo off
(
echo FX1
echo C:\CMK15.TXT
echo YX3
echo YX4
echo 12
echo ENGINESTARTER
)>file.txt
PROG5.EXE <file.txt
Re: prog2.bat controls the external prog1.exe
Usually helps to know what the name of the program is. For all we know the prgram can take command line arguments and it then is just a matter of looking at the help for the program to learn the syntax.
-
- Expert
- Posts: 976
- Joined: 15 Jun 2012 13:16
- Location: Italy, Rome
Re: prog2.bat controls the external prog1.exe
aSlavonian wrote:Please Help me,
I use interactive qbasic prog5.exe that after starting (the win_xp) requirements six times data input via keyboard. After that, do its job and prints text and diagram on the screen. Please help to make Start5.bat command that would be accomplished automatically with the prepared data into text*.txt files located on the C: drive.
I apologize for my poor English use- ogle translator
thank you
my idea?
Start5.bat
C: \ PROG5.EXE '' contents of files
<TYPE TEXT1.TXT '' text1 = "FX1"?
<TYPE TEXT2.TXT '' text2 = "C:\CMK15.TXT"
<TYPE TEXT3.TXT '' text3 = "YX3"
<TYPE TEXT4.TXT '' text4 = "YX4"
<TYPE TEXT5.TXT '' TEXT5 = "12"
<TYPE TEXT6.TXT '' TEXT6 = "ENGINESTARTER"
If you can use cscript, you can use "sendkeys"
einstein1969
-
- Posts: 3
- Joined: 25 Jan 2014 17:33
Re: prog2.bat controls the external prog1.exe
foxidrive wrote:You can try this but it may be the same. This assumes that you don't have any poison characters in your input data like & ) % etc.
Another option is an AutoIt script.Code: Select all
@echo off
(
echo FX1
echo C:\CMK15.TXT
echo YX3
echo YX4
echo 12
echo ENGINESTARTER
)>file.txt
PROG5.EXE <file.txt
My input data are exactly as I stated them respectively. After launching direct prog5.exe I typing for
the first input FX1 enter
the second input C:\CMK15.TXT enter
the third input YX3 enter
the fourth input YX4 enter
the fifth input 12 enter
the sixth input ENGINESTARTER enter
thereafter prog5.exe do its job