安裝卸載Windows服務

來源:互聯網
上載者:User
執行個體:sc create resin2-80 binpath= "D:\resin2-80\bin\httpd.exe" displayname= "resin2-80"sc create resin2-8088 binpath= "D:\resin2-8088\bin\httpd.exe" displayname= "resin2-8088"D:\resin2-80\bin\httpd.exeD:\resin2-8088\bin\httpd.exe"D:\resin2-80\bin\httpd.exe" -service -java_home d:\Java\jdk1.6 -Xmx512m"
"D:\resin2-8088\bin\httpd.exe" -service -java_home d:\Java\jdk1.6 -Xmx512m"D:\mysql\bin>mysqld -remove
Service successfully removed.
MySql有好幾種服務模式,具體情況看MySql的服務資訊。如果換一種方式直接用sc也很簡單

C:\Documents and Settings\zhangxudong>sc delete MySql
[SC] DeleteService 成功

另,偶再把最近學到的windows命令總結一下(加粗加亮部分):

C:\Documents and Settings\zhangxudong>tasklist
//類似於linux下的ps安裝服務
sc create svnservice binpath= "d:\p\subversion\bin\svnserve.exe --service -r e:\repos" displayname= "svnservice" depend= Tcpip
sc config svnservice start= auto刪除服務
sc delete svnservice修改配置
sc config svnservice binpath= "d:\p\subversion\bin\svnserve.exe --service -r e:\repos" displayname= "svnservice" depend= Tcpip設定為自啟動
sc config svnservice start= auto啟動服務
net start svnservice如下:
===============================================
文法:sc create | delete | config 服務名 [參數]
主要參數列表:
  start= demand|boot|system|auto|disabled|delayed-auto  //啟動類型
  binPath= BinaryPathName                //可執行檔路徑
  depend= 依存關係(以 / (斜杠) 分隔)
  DisplayName= <顯示名稱>                //螢幕顯示名稱作用依次是:建立、移除、重佈建服務。例如:重新設定服務mysql的執行路徑的方法是:
sc config mysql binPath= "新路徑"
================================================

本文出自 51CTO.COM技術部落格

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.