顯示具有 sc 標籤的文章。 顯示所有文章
顯示具有 sc 標籤的文章。 顯示所有文章

2017年12月14日 星期四

【Windows Service 服務 安裝/移除】指令 InstallUtil vs 指令 sc

【指令:InstallUtil】
指令說明網址:https://docs.microsoft.com/zh-tw/dotnet/framework/tools/installutil-exe-installer-tool
MSDN 關於InstallUtil說明網址 :https://msdn.microsoft.com/zh-tw/library/50614e95(v=vs.110).aspx

註冊服務
C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe C:\MyService.exe
or
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\installutil.exe

刪除服務
C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe C:\MyService.exe /u
or
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\installutil.exe /u

【指令:sc】
sc create | delete | config 服務名 [參數]
註冊服務
sc create Tomcat binPath= F:\apache-tomcat\bin\startup.bat start= auto
刪除服務(服務名稱)
sc delete MyService


刪除時要先查詢服務名稱
COMMAND 指令
services.msc