Could you guys help me? I Need help to create a .bat or cmd script that:
1. check if the service is running edpa.exe
2. if so, does not install the agent
3. if not, run the agent installation script
The purpose is to add this at a script logon at machines.
Does anyboby already made it? or Know how to write ir?
Thank you so much!
Here is how to see if a process is running..there are a few ways fo doing this..
tasklist /FI "IMAGENAME eq myapp.exe" 2>NUL | find /I /N "myapp.exe">NUL
if "%ERRORLEVEL%"=="0" echo Programm is running
tasklist /FI "IMAGENAME eq notepad.exe" /FO CSV > search.log
FOR /F %%A IN (search.log) DO IF %%~zA EQU 0 GOTO end
wmic process where (name=%EXEC_CMD%) get commandline | findstr /i %EXEC_CMD%> NUL
if errorlevel 1 (
) else (
@echo not starting %EXEC_CMD%: already running.