0

I need to run 'a.exe'. When I start 'a.exe' file, a console pops up, and I should type "go", then the program start.

If i want to make a batch file to run this program, how should i make this. I tried as below:

///////////
%~d0
cd %~dp0
start a.exe > "go"
pause
///////////

but "go" appears on the batch console, and the "a.exe" program still requires "go" text.

How can i solve this?

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
Junjun
  • 1
  • 1
  • 1

3 Answers3

0

Assuming you are coding a windows .bat script, you can execute any file by just passing the file with its path and its argument on the same line a.exe go, so your script would be something like this:

@echo off
c:\path\to\file\a.exe go
PAUSE

I am turning off CMD echo so the output of a.exe is easier to be read.

There is another question here were this is further explained: Create a batch file to run an .exe with an additional parameter.

On the other hand, if you need to call another script, you would need to use the method call

@echo off
call c:\path\to\other\script\script.bat
c:\path\to\file\a.exe go
PAUSE
Community
  • 1
  • 1
Kramer
  • 26
  • 4
0

You can use:

start echo go| a.exe
Bali C
  • 30,582
  • 35
  • 123
  • 152
-2

Just type in

a.exe go

Hope it helped you out.

You can also use it to run files through certain programs

photoshop img.png
DCT A
  • 21
  • 5