1.

Solve : if Service is running then GOTO :Next?

Answer»

Is there a way with batch script to check if a system SERVICE is running and if it is, then have the batch script go to specific line :next in the script..??Code: [Select] tasklist /FI "imagename eq #insert process name#">Nul
if errorlevel 0 goto next

FBthis didnt WORK for me but i found another solution..



this can be done in 1 line so i edited it

for /f "tokens=1*" %a in ('tasklist /FI "Imagename eq cmd.exe" ^|FIND /I "cmd.exe"') do if not "%a"=="cmd.exe" Goto Next Yeeah, but if you put that code in a batch, then cmd.exe is sure to be running, isn't it?
its an EXAMPLE Quote from: diablo416 on August 31, 2008, 12:09:01 PM

its an example

I know


Discussion

No Comment Found