當前位置:編程學習大全網 - 電腦編程 - c# windows service 通過bat文件來安裝和卸載自己寫的服務

c# windows service 通過bat文件來安裝和卸載自己寫的服務

安裝:程序名 + /install 或程序名 + /service

啟動:net start + 服務名 或 sc start +服務名

停止:net stop + 服務名 或 sc stop +服務名

卸載:sc delete +服務名 或 程序名+ /uninstall

例:對C盤根目錄下的AA.exe(服務名:AA)進行操作的BAT如下:

C:\\aa /install

sc start aa

sc stop aa

c:\\aa /uninstall

  • 上一篇:Linux哪個發行版適合編程 比較穩定 Ubuntu好不好用
  • 下一篇:電腦是誰發明的!
  • copyright 2024編程學習大全網