#Searches tasklist for "IMAGENAME eq abserver.exe" (ABServer service) #If ABService is NOT found to be running, script ends #If ABService is found to be running, script continues and executes: abserver.exe -syncnow
@echo off tasklist /FI "IMAGENAME eq abserver.exe" /FO CSV > search.log
FINDSTR ABServer.exe search.log > found.log
FOR /F %%A IN (found.log) DO IF %%~zA EQU 0 GOTO end
exit
:end
@echo Running ABServer.exe -syncnow
cd "C:\Program Files\Microsoft Office Communications Server 2007 R2\Server\Core"
abserver.exe -syncnow
del search.log del found.log