2010-11-12 122 views

回答

1

我有我的Java應用程序(入口點僅僅是public static void main(String[] args))工作作爲下面

@prunsrv //IS//SMTPMan --DisplayName="SMTPMan Proxy" \ 
--Install="C:\devel\_Executables\SMTPManService\prunsrv.exe" \ 
--Startup auto --Jvm auto --StartMode jvm --StopMode jvm \ 
--StartClass eu.javaman.smtp.Service --StartMethod main \ 
--StopClass eu.javaman.smtp.Service --StopMethod main \ 
--StopParams stop --Classpath C:\devel\_Executables\SMTPManService\SMTPMan.jar \ 
--LogPath C:\devel\_Executables\SMTPManService \ 
--Description "Smtp Proxy service by xxx" \ 
--StdOutput C:\devel\_Executables\SMTPManService\SMTPMan.log \ 
--StdError C:\devel\_Executables\SMTPManService\SMTPMan.log \ 
--Type interactive 

代碼窗口服務沒有停止通過上面的腳本安裝服務時,一定的警示作用,但它沒有塞所以我不介意:)

總是使用完全指定的路徑,也檢查http://commons.apache.org/daemon/procrun.html您的具體需求;但不使用「=」 :)

如果param值包含空格敷在引號
是否正確安裝的服務,您可以輕鬆地使用prunmgr.exe啓動/停止(也修改所有提到的參數值),這個接口有兩個或三個比一個更接近通選項卡服務窗口控制

的空間路徑中存在另一個線程找到解決方法:

@rem #FOR %%F IN ("C:\Program Files\prunsrv.exe") DO SET prunsrv=%%~sF <br> 
@rem #prunsrv … --Install=%prunsrv%