Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Apache prunsrv:解析命令行时出错_Windows_Procrun - Fatal编程技术网

Windows Apache prunsrv:解析命令行时出错

Windows Apache prunsrv:解析命令行时出错,windows,procrun,Windows,Procrun,我正在尝试启动一个Java程序作为Windows服务。谷歌搜索我找到了一个install.bat来安装和启动我的服务 正如我在互联网上发现的,我已将prunsrv.exe重命名为IdentificationService.exe D:\IdentificationService\bin\IdentificationService.exe //IS//IdentificationService D:\IdentificationService\bin\IdentificationService.e

我正在尝试启动一个Java程序作为Windows服务。谷歌搜索我找到了一个install.bat来安装和启动我的服务

正如我在互联网上发现的,我已将prunsrv.exe重命名为IdentificationService.exe

D:\IdentificationService\bin\IdentificationService.exe //IS//IdentificationService
D:\IdentificationService\bin\IdentificationService.exe //US//IdentificationService --Install=D:\IdentificationService\bin\IdentificationService.exe --Description= Identification Service --Jvm="C:\Program Files (x86)\\Diginet\java\bin\server\jvm.dll" --Classpath=D:\IdentificationService\lib --StartMode=jvm --StartClass=br.com..digis.DiginetIdentificationService --StartMethod=start --StartParams=start --StopMode=jvm --StopClass=br.com..digis.DiginetIdentificationService --StopMethod=stop --StopParams=stop --LogPath=D:\IdentificationService\logs --StdOutput=auto --StdError=auto
net start IdentificationService
我的问题是,每次执行IdentificationService时,它都会显示“错误解析命令行”

我试图用双引号将所有参数括起来。同样的结果

我尝试使用原始的prunsrv.exe,但没有重命名它。同样的结果


我缺少什么?

尝试通过环境变量设置参数

set SERVICE_NAME=CsvToXmlService
set PR_INSTALL=%cd%\prunsrv.exe
set PR_DESCRIPTION=CsvToXml Service

REM Service log configuration
set PR_LOGPREFIX=%SERVICE_NAME%
set PR_LOGPATH=%cd%
set PR_STDOUTPUT=%cd%\stdout.txt
set PR_STDERROR=%cd%\stderr.txt
set PR_LOGLEVEL=Error

REM Path to java installation
set PR_JVM=C:\Program Files\Java\jre7\bin\server\jvm.dll
set PR_CLASSPATH=%cd%\target\app.jar

REM Startup configuration
set PR_STARTUP=auto
set PR_STARTMODE=jvm
set PR_STARTCLASS=ru.misterparser.csvtoxmlservice.Main
set PR_STARTMETHOD=start

REM Shutdown configuration
set PR_STOPMODE=jvm
set PR_STOPCLASS=ru.misterparser.csvtoxmlservice.Main
set PR_STOPMETHOD=stop

REM JVM configuration
set PR_JVMMS=256
set PR_JVMMX=1024
set PR_JVMSS=4000
set PR_JVMOPTIONS=-Duser.language=RU;-Duser.region=ru

REM Install service
prunsrv.exe //IS//%SERVICE_NAME%

sc start %SERVICE_NAME%

将exe重命名回prunsrv,并使用完全相同的参数运行它(第一个exe ofc除外)

这样运行,但procrun站点说我可以使用具有相同结果的单行命令。事实并非如此。不管怎样,谢谢你的回答。那是很久以前的事了。从那时起,这项服务就用C#重写,效果非常好。不管怎样,我在找到的一个旧备份上尝试了你的建议。“分析命令行时出错”仍然存在。谢谢你的回答。