Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.
for example I have a .bat file such as this :
C++
@ECHO OFF
cd /d D:\
anApp.exe
sthcmd D:\abc.text

now I want send command to anApp.exe
in cmd window I do this like this :
C++
C:\>cd /d D:\
D:\>anApp.exe
AnApp>sthcmd D:\abc.text

but when do taht with .bat file it work to line 3 and just run anApp.exe and dont send sthcmd to anApp.exe
how can I do that with .bat file ?
Posted
Updated 22-Mar-14 1:59am
v2
Comments
kiquenet.com 12-Jan-18 11:10am    
anApp source code ?

what is sthcmd ?

1 solution

Try:
@ECHO OFF
cd /d D:\
ECHO sthcmd D:\abc.text | anApp.exe
 
Share this answer
 
Comments
mohammadali1375 22-Mar-14 8:33am    
oh I want send some Successive command . whit this way .bat file send none comand after D:\abc.text
OriginalGriff 22-Mar-14 8:43am    
That's not quite how batch files work: you would have to put the list of commands into a file, and pipe that to the command.
You can't just enter the commands you want to give in the batch file after the application name, because the batch file stops processing until the application exits.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900