@REM debe ser ejecutado con Administrador
@echo off
@cd /d "%~dp0"
set InstallServiceName="Smart Service AgentRpa"
set InstallServiceDesc="Sevice AgentRpa used for execute bot SmartRuntime"
@REM se elimina si existe el servicio
sc stop %InstallServiceName%
sc delete %InstallServiceName%

SET relativePath=%CD%
SET executablePath=%relativePath%\Service.SmartBroker.exe
SET %executablePath%=%executablePath%
echo %executablePath%
cd c:
cd %WINDIR%\Microsoft.NET\Framework64\v4.0.30319\

sc create %InstallServiceName% BinPath= %executablePath% DisplayName= %InstallServiceName% start= auto
sc description %InstallServiceName% %InstallServiceDesc%
sc failure %InstallServiceName% actions= restart/60000/restart/60000/""/60000 reset= 86400
net start %InstallServiceName%

pause