2019-11-24 13:32

增加Windows服务程序

-颜正义

数据库

(1131)

(0)

收藏

假如本机上已有一个可执行程序:D:\Software\OtherTool\MonitorFolder.exe。我们先打开控制台,输入如下命令:

sc create monitor binpath= "D:\Software\OtherTool\MonitorFolder.exe"

注意等号后面都有空格,创建成功后会有提示:SC] CreateService 成功


monitor为你要创建的服务名

binpath为要启动的文件的根路径 要加上双引号


例:

C:\WINDOWS\system32>sc create MySQL8.0 binPath= "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe"

[SC] CreateService 成功

1574572941(1).png




0条评论

点击登录参与评论