我创建了一个。将运行模型的批处理如下。在命令提示符 (DOS) 我这样做: C:\Program Files\Portico\portico-1.0.2\exec> executePortico.bat name_model
示例:executePortico.bat ExampleCPPFederate
但是这个错误:
'C:\Documents' 不是内部命令或外部可运行程序或批处理文件。"C:\Program Files\Portico\portico-1.0.2\examples\cpp\cpp13\" ExampleCPPPe derate.cpp 按任意键继续。. . '"C:\Program Files\Portico\portico-1.0.2\examples\cpp\cpp13\" ExampleCPPF ederate2 '不被识别为内部命令或外部可运行程序或批处理文件。终止 - 正常
查看我的代码:
@echo off
rem ###########################
rem # implementation/version #
rem ###########################
rem ################################
rem # check command line arguments #
rem ################################
:checkargs
if "%0" == "" goto usage
if "%1" == "" goto usage
rem #######################
rem # test for JAVA_HOME #
rem #######################
if "%JAVA_HOME%" == "" goto nojava
goto rtihometest
:nojava
echo ERROR Your JAVA_HOME environment variable is not set!
goto usage
rem #######################
rem # test for RTI_HOME #
rem #######################
:rtihometest
call C:\Arquivos de programas\Portico\portico-1.0.2\etc\confvarsC.bat
if not "%RTI_HOME%" == "" goto execute
############################################
### (target) execute #######################
############################################
:execute
SHIFT
set PATH=%JAVA_HOME%\jre\bin\client;%RTI_HOME%\bin;%PATH%
set RTI_FEDDIR="C:\Arquivos de programas\Portico\portico-1.0.2\examples\cpp\cpp13\"
set EXEC="C:\Arquivos de programas\Portico\portico-1.0.2\examples\cpp\cpp13\"
if "%0" == "m" goto exec1
:exec1
echo %EXEC%%1%.cpp
pause
%EXEC%%1%.cpp %2
goto finish
:usage
echo usage: executePortico.bat [model] [nome modelo]
goto err
:err
echo Terminated - Error
goto end
:finish
echo Terminated - Normal
:end
我需要做以下事情:我需要在这个软件中运行示例,这样我才能创建一个文件。我在命令提示符中运行的位置: executaPortic.bat name_model 我这样做了:
@echo off
rem ###########################
rem # implementation/version #
rem ###########################
rem ################################
rem # check command line arguments #
rem ################################
:checkargs
if "%0"=="" goto usage
if "%1"=="" goto usage
rem #######################
rem # test for JAVA_HOME #
rem #######################
if "%JAVA_HOME%"=="" goto nojava
goto rtihometest
:nojava
echo ERROR Your JAVA_HOME environment variable is not set!
goto usage
rem #######################
rem # test for RTI_HOME #
rem #######################
:rtihometest
call C:\Portico\portico-1.0.2\etc\confvarsC.bat
if not "%RTI_HOME%"=="" goto execute
############################################
### (target) execute #######################
############################################
:execute
SHIFT
set PATH=%JAVA_HOME%\jre\bin\client;%RTI_HOME%\bin;%PATH%
set RTI_FEDDIR=C:\Portico\portico-1.0.2\examples\cpp\cpp13\
set EXEC=C:\Portico\portico-1.0.2\examples\cpp\cpp13\
rem ###########################
rem # if "%0"=="m" goto exec1
rem ###########################
goto exec1
:exec1
echo %EXEC%%1.exe
pause
"%EXEC%%1.exe" %2
goto finish
:usage
echo usage: executePortico.bat [model] [nome modelo]
goto err
:err
echo Terminated - Error
goto end
:finish
echo Terminated - Normal
:end
但是现在出现这个错误: C:\Portico\portico-1.0.2\exec>executePortic.bat main The input line is too long。