Hey drumpat01,
Sure I can. I am not a scripting expert or anything, but maybe you can use it as a jumping off point.
- @ECHO OFF
- REM sleep 15
- tasklist | find "Greenshot" > NUL 2>&1 && set terminateproc=0 || set terminateproc=1
- REM echo %terminateproc%
- if %terminateproc% == 0 (
- taskkill /F /T /IM Greenshot*
- )
So basically what this does is it lists all the processes currently on the system and 'looks' for a process that contains "Greenshot". You would replace "Greenshot" with the name of your process. Then if the find is "successful" then "terminateproc" is set to 0. This means that we need to kill the process. If the "Greenshot" process is not found, then "terminateproc" is set to 1 and we do nothing at all.
In the "if" statement, we just check if "terminateproc" is set to 0 and if it is then the taskkill command is run.
You can remove the "REM" beside the echo to see if your "terminateproc" is getting set properly.
Hopefully this helps.
Cheers