将exe作为服务启动

-- 添加服务
sc create CoServices binpath= D:\sf\code\xky\test\CoServices.exe start= auto DisplayName= CoServices
-- 删除服务
sc delete CoServices

  

 

-- 查询端口号
netstat -ano|findstr 端口号 
-- 杀死该端口进程
taskkill /f /pid 端口号 

  

posted @ 2023-06-02 10:00  CrossPython  阅读(90)  评论(0)    收藏  举报