Windows服務的安裝、卸載

來源:互聯網
上載者:User

標籤:2.0   wss   視圖   stop   輸入   esc   目錄   framework   校訊通   

 

建立一個Windows服務

http://jingyan.baidu.com/article/fa4125acb71a8628ac709226.html

 

安裝服務

使用FramWork架構內建的InstallUtil.exe工具安裝服務

一般使用命令列安裝服務,快捷速度

InstallUtil位置:C:\Windows\Microsoft.NET\Framework\

不同版本所在目錄不同,framework2.0在v2.0.50727目錄下

方式一:

以管理員身份運行cmd輸入

C:\Windows\Microsoft.NET\Framework\v4.0.30319.InstallUtil.exe E:\TestApp\Winform\WinServiceTest\WinServiceTest\bin\Debug\WinServiceTest.exe 斷行符號即可安裝服務

方式二:

Dat檔案:

%~dp0InstallUtil.exe %~dp0WindowsServiceForWCFDemo.exe

pause

命令列學習:cd 進入目錄 cd..退出目錄 pause 暫停 %~dp0目前的目錄 start開始

Windows指令碼bat檔案

 

卸載

 

方式一:

Dat檔案刪除:

%~dp0InstallUtil.exe /uninstall  %~dp0WindowsServiceForWCFDemo.exe

pause

方式二:

以管理員身份運行cmd,輸入sc delete 服務名

服務在資源管理員的服務名是ServiceName 描述是DisplayName  

在服務裡是服務名是DisplayName  描述是DescribeName

  開啟服務:net start xxt_service

關閉服務:net stop xxt_service

在設計檢視點擊右鍵,選擇“添加安裝程式”,新增serviceProcessInstaller1和serviceInstaller1兩個組件。

serviceProcessInstaller1屬性設定如下:

Account : localsystem 表示所有使用者均可使用本服務。

serviceInstaller1屬性設定如下:

Description:校訊通類比話機定時檢測服務 表示將要出現在windows服務管理員中的服務描述。

Displayname:xxt_service 表示將要顯示在windows服務管理員中的服務名稱。

使用

http://www.cnblogs.com/jiewei915/archive/2010/12/14/1905395.html

一次安裝兩個服務

 

Windows服務的安裝、卸載

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.