svn sc create 命令行創建服務自啟動



今天重裝了系統,Subversion服務也得重裝。照例輸入代碼:

 

sc create svnserve binpath="d:\PortableApps\svn\svnserve.exe --service -r e:\svn" displayname="Subversion" depend=tcpip start=auto

可是居然出現了下面的提示:

 

D:\PortableApps\svn>sc create svnserve binpath="d:\PortableApps\svn\svnserve.exe
 --service -r e:\svn" displayname="Subversion" depend=tcpip start=auto
Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ]  ...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
 type= <own|share|interact|kernel|filesys|rec>
       (default = own)
 start= <boot|system|auto|demand|disabled>
       (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= 
 group= 
 tag= <yes|no>
 depend= <dependencies(separated by="" (forward="" slash))="">
 obj= <accountname|objectname>
       (default = LocalSystem)
 DisplayName= 
 password= 

我仔細檢查注冊表,沒有同名的服務啊!浪費了半小時,才搞清楚,binpath=、dispalyname=、depend=后面是必須要有一個空格的。否則就會執行不成功。這語法,太奇怪了……
所以,正確的代碼應該是這樣:

sc create svnserve binpath= "d:\PortableApps\svn\svnserve.exe --service -r e:\svn" displayname= "Subversion" depend= tcpip start= auto

那么,原來我是怎么執行成功的呢?仔細想了想,以前的代碼是直接從SVN幫助中復制的 :em23:

 

from: http://zengrong.net/post/457.htm


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM