How do I make an exe run automatically when another exe is launched?
Example :
EXE 1 is launched & running
EXE 2 will run automatically once it see that the EXE 1 has already launched.
What is the command do I use in .bat file or autorun.inf?
How do I make an exe run automatically when another exe is launched?
Example :
EXE 1 is launched & running
EXE 2 will run automatically once it see that the EXE 1 has already launched.
What is the command do I use in .bat file or autorun.inf?
Here you go
start exe1.exe
:LOOP
tasklist /nh /fi "imagename eq exe1.exe" | find /i "exe1.exe" >nul && start exe2.exe || goto :LOOP
That will start exe1.exe
and will keep looking to see if it has started before running exe2.exe
.
@ECHO OFF
START /D "path" myexe1.exe
START /D "path" myexe3.exe
Taken from here.
Then save the file as "somename.bat"
Edit
Due to your last comment here's what I found
@echo off
tasklist /nh /fi "imagename eq chrome.exe" | find /i "chrome.exe" >nul && (
echo Windows Media Player is running
) || (
echo Chrome is not running
)
pause>nul
I just copied the code from the link, google can be very helpful.