2

I have two . exe application that conflict eachother ( App_A and App_B). I want to warn the user when he launch App_B if App_A is already running.

ps: the warning message must really open before App_B launch, not 1 sec after. The message warning would be :

Are you sure you want to launch App_B ? App_A is already running! Yes/ No

The user can try to launch App_B either from desktop shortcut of from a associated file. (user click on the file and it auto-launch App_B to edit the file.)

App_A and App_B aren't my software, I can't edit them. I think I must use an external automation software.

Does somebody have any idea on which software I could use ? I have tried Window scheduler with batch file (no sucess), but I am open to any other solution. I have tried with automation tool like Eventghost with no sucess

n0tis
  • 133

1 Answers1

2

Something to try:

Example batch file (obviously untested ;) ):

@echo off
REM Check for process
tasklist /fi "Imagename eq App_A.exe" 2>NUL | find /i /n "App_A.exe">NUL
REM If it isn't found (errorlevel > 0) launch App_B
if %ERRORLEVEL% GTR 0 goto LaunchB

REM Otherwise (errorlevel 0) it's been found, so ask for confirmation...
choice /C YN /M "App_A is running, continue launching App_B?"
if %ERRORLEVEL% EQU 1 goto LaunchB
if %ERRORLEVEL% GTR 1 exit

:LaunchB
App_B2.exe %1 %2 %3 %4 %5