第一步,先创建服务会显示下方的方法
C:\Users\Administrator>sc create Strial
描述:
在注册表和服务数据库中创建服务项。
用法:
选项:
注意: 选项名称包括等号。
等号和值之间需要一个空格。
type= <own|share|interact|kernel|filesys|rec|userown|usershare>
(默认 = own)
start= <boot|system|auto|demand|disabled|delayed-auto>
(默认 = demand)
error= <normal|severe|critical|ignore>
(默认 = normal)
binPath= <.exe 文件的 BinaryPathName>
group=
tag= <yes|no>
depend= <依存关系(以 / (斜杠)分隔)>
obj= <AccountName|ObjectName>
(默认= LocalSystem)
DisplayName= <显示名称>
password= <密码>
第二步就可以创建服务
根据上方的格式 :
sc “server” create [service name] [binPath= ] “option1” “option2”…
C:\Users\Administrator>sc create Strial binpath= F:\xxx\xxx\xx\xxx\xxx.exe start= auto DisplayName= xxx
注意"="后面必须加空格
常用的一些方法
netstat -ano|findstr 端口号 查询端口号
taskkill /f /pid 端口号 杀死该端口进程
net start Gexe 开启服务
sc delete 服务名 删除服务