I have a utility abc.exe that launches a special command prompt. By special I mean, certain environment variables are set on that prompt. Next I have to run a set of commands on this special command window. I have combined all such commands into a batch file and run this bat file. However, these are still 2 steps.
- Launch special command prompt through abc.exe(can be run through command line)
- Run commands.bat
I want to combine these 2 steps in single batch file such that, the commands.bat or rather the commands contained in that file are run on special command prompt only. Is this possible by somehow restricting/directing commands on a specific command prompt?
Now I do not have code for abc.exe, so only thing I can do with it is launch the special command prompt through it.
abc.exe
tool have no command line switch (or some key in environment or .ini file) which allows to pass a batch file for execution to it and do not accept the input from std. input, the only way I see is to create a batch or script which starts the tool, waits for a special console (or detects it by a capture) and then sends your batch file to this console window char-by-char usingsendkeys
. – Akina Nov 6 '18 at 7:28