Windows手工建立服務方法
windows下sc create命令列新增/建立/修改服務
sc create BITS binpath= “C:WINDOWSsystem32svchost.exe -k netsvcs” type= share start= auto displayname= “Background Intelligent Transfer Service” depend= RpcSs/EventSystem
修改描述:
sc description BITS “利用空閒的網路頻寬在後臺傳輸檔案。如果服務被停用,例如 Windows Update 和 MSN Explorer 的功能將無法自動下載程式和其他資訊。如果此服務被禁用,任何依賴它的服務如果沒有容錯技術以直接通過 IE 傳輸檔案,一旦 BITS 被禁用,就可能無法傳輸檔案。”
新增服務:
sc create PolicyAgent binpath= “C:WINDOWSsystem32lsass.exe” type= share start= auto displayname= “IPSEC Services” depend= RPCSS/Tcpip/IPSec
修改描述:
sc description PolicyAgent “提供 TCP/IP 網路上客戶端和伺服器之間端對端的安全。如果此服務被停用,網路上客戶端和伺服器之間的 TCP/IP 安全將不穩定。如果此服務被禁用,任何依賴它的服務將無法啟動。”
SC命令的更多用法請在檢視help sc
(登錄檔修改前請做好備份),
SvcHost共享服務的特別之處:或許重啟後還需要到登錄檔位置:[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionSvcHost],檢視”C:WINDOWSsystem32svchost.exe -k netsvcs”以紅色字為名的鍵(這裡以netsvcs為例),鍵值裡是否定義有sc create BITS藍色字的服務(這裡以BITS為例),如果沒有就在鍵值把服務名(這裡以BITS為例)新增上去,再重啟一次。
需要將程式設定成Windows服務的情況,可以利用一下windows自帶的sc命令來建立服務.
該命令的基本用法如下:
開啟cmd命令, 輸入如下資訊:
1 建立服務:
sc create SecServer binpath= “E:DeskMasterMainConsoleSecurityMagCenter2.exe -service” displayname= “SecServer2” depend= Tcpip start= auto
(注意有一個空格)
sc create IIMSAService0 binPath= “”C:Program FilesIIMSAServiceIntnal.exe” -service” displayname= “IIMSAService0” depend= Tcpip start= auto
上述紅色字型部分, 需要替換為所建立服務的資訊. 程式的路徑不要放在中文目錄下.
在cmd中執行命令後, 如果沒有報錯, 正常情況下在服務管理器(services.msc)中能看到一個SecServer的服務.
2 刪除服務:
sc delete SecServer
3 其它命令使用方法, 輸入 sc /? 進行檢視.
相關文章
- Windows服務建立及安裝Windows
- 使用C#建立windows服務續之使用Topshelf優化Windows服務C#Windows優化
- 使用.NET Core建立Windows服務詳細步驟Windows
- weblogic手工建立簡單域的方法Web
- 使用C#建立安裝Windows服務程式(乾貨)C#Windows
- Windows 服務管理Windows
- 程式設計師必備技能:一鍵建立windows 服務程式設計師Windows
- 建立Linux服務Linux
- Windows服務的手動新增和刪除方法Windows
- oracle xe 10g 手工建立資料庫 for windows XPOracle資料庫Windows
- 如何使用Topshelf與.NET泛型主機建立Windows服務泛型Windows
- windows配置MySql服務WindowsMySql
- Windows服務詳解Windows
- windows 服務例項Windows
- windows10系統開啟iis服務的方法Windows
- windows time服務無法啟動的解決方法Windows
- node中建立服務程式
- 用Delphi建立服務程式
- win10 進入管理服務方法 windows10系統服務怎麼進入Win10Windows
- 手工建立資料庫資料庫
- 手工建立控制檔案
- ElasticSearch註冊Windows服務ElasticsearchWindows
- c#寫windows服務C#Windows
- win10系統windows defender antivirus service服務禁用方法Win10Windows
- Windows10系統停止正在執行服務的方法Windows
- Windows10系統關閉Remote Registry服務的方法WindowsREM
- 2.8.1.4 建立資料庫服務資料庫
- python如何建立web服務PythonWeb
- Windows10系統下關閉家庭組服務的方法Windows
- 手工命令建立資料庫資料庫
- Oracle 手工建立資料庫Oracle資料庫
- 手工建立oracle資料庫Oracle資料庫
- windows下啟動nacos服務Windows
- windows開啟ssh服務教程Windows
- Windows關閉Microsoft Defender服務WindowsROS
- asp.net 控制windows服務ASP.NETWindows
- Windows服務程式圖文教程Windows
- 使用Go語言建立WebSocket服務GoWeb