一 概述
- exe程序添加到Windows服务
.bat
批处理文件添加到Windows服务
二 exe程序添加到Windows服务
2.1 创建——管理员模式
sc.exe create "Service Name" binPath= "C:\Your Program.exe"
//注:binPath=后的空格,binPath指定的是.exe文件的绝对路径
2.2 删除——管理员模式
sc.exe delete "Service Name"
2.3 启动
sc.exe start "Service Name"
2.4 停止
sc.exe stop "Service Name"
三 .bat
批处理文件添加到Windows服务
3.1 创建
service.bat install
3.2 删除
sc delete "Service Name"