bat 安装服务后,服务设置了“自动”,重启电脑服务没有自动启动
需要设置“允许服务与桌面交互”,安装脚本增加下面红色部分
sc delete ServiceName
taskkill /f /im Service.exe
sc create ServiceName binPath="%~dp0Service.exe"
sc config ServiceName start=auto type= own type= interact
sc start ServiceName
需要设置“允许服务与桌面交互”,安装脚本增加下面红色部分
sc delete ServiceName
taskkill /f /im Service.exe
sc create ServiceName binPath="%~dp0Service.exe"
sc config ServiceName start=auto type= own type= interact
sc start ServiceName