I am trying to test the service which is running or not, hence wrote the below code. It running fine till starting the webpage, after which its not going to the next command (i.e., line number 4). Can someone pls help me to crack it.
Code: Select all
sc \\server_name query ActiveMQ | find /I "STATE" | find "RUNNING"
if errorlevel 1 goto end
sc \\server_name | start http://localhost:1234/
if errorlevel 1 goto end
echo URL is running
goto success
:success
echo Activmq running fine
:end
echo **Error
echo %date% %time% -- Stopping the services - END
Thanks in advance Quick response is appreciable.