Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.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 创建服务后停止批处理文件_Windows_Batch File - Fatal编程技术网

Windows 创建服务后停止批处理文件

Windows 创建服务后停止批处理文件,windows,batch-file,Windows,Batch File,我的批处理脚本在“service.bat安装”之后不执行任何行。我已经尝试了我能想到的一切。如果我把这句话注释掉,那么一切都正常。似乎脚本在创建服务后停止。请帮忙 @echo off net stop Tomcat7 REM ------------- Unzipping the zip file contents to a TEMP folder -------------------- call unzip C:\Test\test.zip -d C:\Test\TEMP REM

我的批处理脚本在“service.bat安装”之后不执行任何行。我已经尝试了我能想到的一切。如果我把这句话注释掉,那么一切都正常。似乎脚本在创建服务后停止。请帮忙

@echo off
net stop Tomcat7
REM ------------- Unzipping the zip file contents to a TEMP folder --------------------    
call unzip C:\Test\test.zip -d C:\Test\TEMP

REM ------------- Removing the existing folder and updating with the latest war file --   
REM rmdir /s /q C:\Test\apache-tomcat-7.0.52-test\webapps\Web
copy /y C:\Test\TEMP\Photo.war C:\Test\apache-tomcat-7.0.52-test\webapps

xcopy /y C:\Test\TEMP\Scheduler C:\BTest /E
sc queryex type= service state= all | find /I "Tomcat7"
if %errorlevel% neq 0 (
cd C:\Test\apache-tomcat-7.0.52-test\bin
service.bat install)   --------------------------------- execution stops here
call md C:\Test\Testing
REM shutdown.exe /r /t 00

如果从批处理文件直接调用其他批处理文件,则执行将转移到被调用的文件,而不会返回调用方

您需要使用
call service.bat安装

这样,当被调用的批处理结束时,执行返回给调用方