@echo off cls rem Script is designed by Build-o-Matic rem This code is completely open source. Feel free to modify it and adapt it for your purpose. REM Change Photoshop.exe for the program of your choice. REM You can find the process name by starting the program, starting CMD from the start button REM and typing TASKLIST. The process name will be in the list. rem this is app one tasklist /FI "IMAGENAME eq Photoshop.exe" 2>NUL | find /I /N "Photoshop.exe">NUL set apponelevel=%ERRORLEVEL% rem this is app two tasklist /FI "IMAGENAME eq HIDMacros.exe" 2>NUL | find /I /N "HIDMacros.exe">NUL set apptwolevel=%ERRORLEVEL% rem Verify and notify that programs are running rem If all is running exit program if %apponelevel%==0 if %apptwolevel%==0 goto Stop rem if none is running go to startall if %apponelevel%==1 if %apptwolevel%==1 goto StartAll rem if only Photoshop is running if %apponelevel%==0 if %apptwolevel%==1 goto StartAppTwo rem if only HID Macros is running if %apponelevel%==1 if %apptwolevel%==0 goto StartAppOne goto stop :StartAppOne start "" /wait Photoshop.exe goto killall :StartAppTwo start "" /D "D:\Portable Apps\HID Macros\" HIDMacros.exe echo Do you want to close both programs? pause goto killall :StartAll rem First starting HID Macros rem Please fill in the full path for HIDMacros start "" /D "D:\Portable Apps\HID Macros\" HIDMacros.exe rem Second starting Photoshop rem Program will start for Photoshop and wait for it to be closed to kill HID Macros start "" /wait Photoshop.exe goto killall :KillAll rem Closing everything once it's over taskkill /F /IM HIDMacros.exe taskkill /F /IM Photoshop.exe goto stop :Stop