|
Answer» So what I'm wondering if there is any BATCH commands I can use to CHECK if another batch file is currently RUNNING and if said batch file is actually running, close/exit it. Thanks PS Im kinda new to batch files so the more simple the commands the better. I don't think so. Batch files run under control of the shell program (either cmd or command). A task LIST would only show that the shell is running.
Opening multiple shell windows produces a fresh copy of the shell program. There is no cross communication between the windows so even the mem command fails to turn up evidence of a executing batch file.
Perhaps there are some third party utilities that can hunt down the elusive batch file. cmdow.exe will find a window by its title.
You can include a line like this in your batch file by using Windows built-in TITLE command.
TITLE id-me
This changes the window title to whatever you want
Then later in another shell window Cmdow can KILL it if it exists
cmdow id-me && cmdow id-me /END
http://www.commandline.co.uk/cmdow/
|