Basically I am trying to open an application (mingwenv.cmd) and run a command in it
/c/Users/jab/src/veins-4.4/sumo-launchd.py -vv -c /c/Users/jab/src/sumo-0.25.0/bin/sumo-gui.exe
via Batch scripting, analogous to opening, say, python.exe
in a new command prompt and running
python -m pip install xlutils
on the command line interface in the new command prompt. I've spent several hours trying to do so, to no avail.
Below are my documented attempts:
sthcmd C:\Users\jab\src\SUMO_OMNeT_connection.txt | C:\Users\jab\src\omnetpp-5.0\mingwenv.cmd
cmd /k & sthcmd C:\Users\jab\src\SUMO_OMNeT_connection.txt | C:\Users\jab\src\omnetpp-5.0\mingwenv.cmd
C:\Users\jab\src\omnetpp-5.0\mingwenv.cmd | C:\Users\jab\src\SUMO_OMNeT_connection.txt
C:\Users\jab\src\SUMO_OMNeT_connection.txt|C:\Users\jab\src\omnetpp-5.0\mingwenv.cmd
C:\Users\jab\src\omnetpp-5.0\mingwenv.cmd < C:\Users\jab\src\SUMO_OMNeT_connection.txt
type C:\Users\jab\src\SUMO_OMNeT_connection.txt | C:\Users\jab\src\omnetpp-5.0\mingwenv.cmd
type C:\Users\jab\src\omnetpp-5.0\mingwenv.cmd | C:\Users\jab\src\SUMO_OMNeT_connection.txt
echo /c/Users/jab/src/veins-4.4/sumo-launchd.py -vv -c /c/Users/jab/src/sumo-0.25.0/bin/sumo-gui.exe | C:\Users\jab\src\omnetpp-5.0\mingenv.cmd
echo "/c/Users/jab/src/veins-4.4/sumo-launchd.py -vv -c /c/Users/jab/src/sumo-0.25.0/bin/sumo-gui.exe" | C:\Users\jab\src\omnetpp-5.0\mingenv.cmd
start C:\Users\jab\src\omnetpp-5.0\mingwenv.cmd /k /wait "/c/Users/jab/src/veins-4.4/sumo-launchd.py -vv -c /c/Users/jab/src/sumo-0.25.0/bin/sumo-gui.exe"
C:\Users\jab\src\omnetpp-5.0\mingwenv.cmd "/c/Users/jab/src/veins-4.4/sumo-launchd.py -vv -c /c/Users/jab/src/sumo-0.25.0/bin/sumo-gui.exe"
preceding the code block but only the last one worked and the highlighting was vastly off) perhaps someone knows how to do that, if it's possible. In the meantime the code block can be copied into Notepad++ and highlighted there. Anyways, here are the results and references per attempt(s):
- crashes (nothing happens) (https://www.codeproject.com/Questions/747981/send-command-to-another-program-with-batch-file)
- basically just prints the command to the cmd prompt, seems to expect other commands
- opens cmd, txt file, and mingwenv.cmd prompt (3 windows) separately
- opens cmd, txt file, and mingwenv.cmd prompt (3 windows) separately
- just opens mingwenv.cmd; all else crashes (How to make a batch file that send application an input char)
- just opens mingwenv.cmd and cmd prompt only (not txt file) (How do I send commands to an EXE running through the command line with batch?)
- just opens txt and cmd prompt only (not mingwenv.cmd)
- does nothing (crashes) (How to make a batch file that send application an input char)
- does nothing (crashes)
- opens mingwenv.cmd and cmd prmpt stays open, that's it though (Bat file to run a .exe at the command prompt)
- opens mingwenv.cmd, cmd prompt crashes (BAT file: Open new cmd window and enter code in there)