1. 程式人生 > >Windows 安裝服務 的兩種方式

Windows 安裝服務 的兩種方式

自定義 兩種 2.0 pen soft pla spl window path

第一種 - 安裝服務時自定義服務名稱:
(註意 binpath= 和路徑之間的那個空格)
sc create 服務名稱 binpath= "D:\Service.exe" displayname= "顯示名稱" depend= Tcpip start= auto (啟動類型)


第二種 - 安裝目錄服務:

C:\Windows\Microsoft.NET\Framework\v4.0.30319 下 2.0也有
InstallUtil.exe D:\Service.exe

卸載服務

InstallUtil.exe /u D:\Service.exe

Windows 安裝服務 的兩種方式