我不希望我的批处理程序在调用 "spl stop" 后终止
I dont want my batch program to terminate after it calls "spl stop"
我的批处理脚本如下:-
@echo off
For /F "tokens=1* delims==" %%A IN (test.properties) DO (
IF "%%A"=="PORT" set PORT=%%B
IF "%%A"=="SPLEBASE" set SPLEBASE=%%B
IF "%%A"=="SPLOUTPUT" set SPLOUTPUT=%%B
IF "%%A"=="SPLENVIRON" set SPLENVIRON=%%B
IF "%%A"=="JAVA_HOME" set JAVA_HOME=%%B
IF "%%A"=="jarsource" set jarsource=%%B
IF "%%A"=="jartarget" set jartarget=%%B
)
echo.
echo The environment properties are as follows :-
echo.
echo port number is %PORT%
echo environment path is %SPLEBASE%
echo environment output location is %SPLOUTPUT%
echo environment name is %SPLENVIRON%
echo java home is %JAVA_HOME%
echo cm jar source location is %jarsource%
echo cm jar target location is %jartarget%
echo.
echo on
cd %SPLEBASE%/bin
spl stop
echo off
:loop
netstat -n -o -a | findstr ":6500"
if %ERRORLEVEL% equ 0 (@echo "listening") ELSE goto exitloop
goto loop
:exitloop
echo server has been stopped
问题是它执行spl stop后,退出了我当前的批处理程序,根本不进入coming循环。 spl.cmd 是一个调用 vb 脚本的文件,该脚本执行并退出,从而终止我当前的批处理程序。我不希望我的批处理程序终止。请提出一些建议,以便我的批处理在 运行 spl stop
之后进入循环
尝试使用 CALL
命令:
call spl stop
我的批处理脚本如下:-
@echo off
For /F "tokens=1* delims==" %%A IN (test.properties) DO (
IF "%%A"=="PORT" set PORT=%%B
IF "%%A"=="SPLEBASE" set SPLEBASE=%%B
IF "%%A"=="SPLOUTPUT" set SPLOUTPUT=%%B
IF "%%A"=="SPLENVIRON" set SPLENVIRON=%%B
IF "%%A"=="JAVA_HOME" set JAVA_HOME=%%B
IF "%%A"=="jarsource" set jarsource=%%B
IF "%%A"=="jartarget" set jartarget=%%B
)
echo.
echo The environment properties are as follows :-
echo.
echo port number is %PORT%
echo environment path is %SPLEBASE%
echo environment output location is %SPLOUTPUT%
echo environment name is %SPLENVIRON%
echo java home is %JAVA_HOME%
echo cm jar source location is %jarsource%
echo cm jar target location is %jartarget%
echo.
echo on
cd %SPLEBASE%/bin
spl stop
echo off
:loop
netstat -n -o -a | findstr ":6500"
if %ERRORLEVEL% equ 0 (@echo "listening") ELSE goto exitloop
goto loop
:exitloop
echo server has been stopped
问题是它执行spl stop后,退出了我当前的批处理程序,根本不进入coming循环。 spl.cmd 是一个调用 vb 脚本的文件,该脚本执行并退出,从而终止我当前的批处理程序。我不希望我的批处理程序终止。请提出一些建议,以便我的批处理在 运行 spl stop
之后进入循环尝试使用 CALL
命令:
call spl stop