I am making a set of batch files made to force restart games when they freeze and won't start back up again.
So I need a batch file that opens cmd.exe, runs the two commands:
taskkill /F example.exe`
and
start example.exe
and lets cmd stay open. Every time I try these two commands cmd is just open for a second and closes saying that no command was made, or the commands aren't able to be used even though they work when I type them into cmd directly.
Best Answer
I need a batch file that opens
cmd
, runs two commands, and keeps cmd openThis is an invalid command. You need to use:
/IM image name
. The image name of the process to be terminated. Wildcard '*' can be used to specify all image names.Use the following batch file (test.cmd):
To run it and keep the
cmd
shell open use the following command:/K
Run Command and then return to the CMD prompt. This is useful for testing, to examine variablesFurther Reading