0

I have scenario where I'm running a .exe file that after running prompts for some user input. So how can I pass some parameters or user input to the .exe file using a batch file. The user input is fixed and going to be a string for ex-ListObjects.

NOTE: The .exe dose not ask for any command line arguments. Once it runs its expecting user to type in
that string.

Coderji
  • 7,655
  • 5
  • 37
  • 51
Gautam
  • 11
  • 3
  • Does the executable run on command line or is does it present a GUI? – Taylor Hx Mar 17 '14 at 04:19
  • hey it has a gui i will be just running the batch file and passing the specified string as input.so i need to write a batch file to pass the sting to the exe when it is running – Gautam Mar 17 '14 at 04:36
  • If it has a GUI, then you will not be able to pass it anything from batch, as batch can not interface with a standalone GUI. If your executable's GUI is written in .NET and uses the Win32 API there *may* be some way to pass the arguments to the GUI using a Visual Basic script. – Taylor Hx Mar 17 '14 at 04:40
  • hey sorry it does not have a gui. how can i do it using bat,i will be running the bat from a .net application. – Gautam Mar 17 '14 at 04:58
  • @Daemon- it would be great if u can help me with writing the batch file. – Gautam Mar 17 '14 at 05:14

1 Answers1

0

See - how to pass input to .exe in batch file?

(
    echo Input1
    echo Input2
) | executable.exe
Community
  • 1
  • 1
unclemeat
  • 5,029
  • 5
  • 28
  • 52