5
I need to run a service for some processes, but first I needed to check if the service is installed.
The commands I use to install and uninstall are as follows::
%DIRServico%\SERVICO.EXE /INSTALL
%DIRServico%\SERVICO.EXE /UNINSTALL
If I try to install it myself already installed, it gives an error and I didn’t want it to appear, so I wanted the bat file itself to be able to check if the service is installed.
Check if it’s running, stop I already have the commands.
NET START | FINDSTR "Servico"
if %ERRORLEVEL% == 1 goto stopped
if %ERRORLEVEL% == 0 goto started
echo comando desconhecido
goto end
:started
NET STOP Servico
goto end
:stopped
NET START Servico
goto end
:end
If anyone has an idea how to fix it I’d appreciate it.
It worked out, thanks!
– Jefferson Rudolf