系统找不到指定的批次标签

时间:2014-01-22 14:04:32

标签: windows batch-file cmd

目前我正在运行此文件,它显示错误

系统找不到指定的批次标签 - Begin_bealelaw

我现在陷入这个问题,这个错误从未发生过。

文件内容为

cd\ 
D:
cd D:\Autodeployment
cd MultipleDeployment
cd Tomcat7-28_app4.sg1_18_01_2014_102046
@echo off

  echo stopping_Tomcat7-28
  sc stop Tomcat7-28 >D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/Tomcat7-28.log
  echo tomcat stopping start at
  TIME /T
  if %errorlevel% EQU 0 goto waitForTomcat
  if %errorlevel% EQU 1062 goto mainProcessStart

  :waitForTomcat
  echo waitForTomcat
  @find /i "stopped successfully" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/Tomcat7-28.log"
  if %errorlevel% EQU 1 goto scCheckRunning

  :scCheckRunning
  echo scCheckRunning
  sc query "Tomcat7-28" >D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/Tomcat7-28.log
  if %errorlevel% EQU 1 goto scCheckStopped

  :scCheckStopped
  echo scCheckStopped
  @find /i "STOPPED" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/Tomcat7-28.log"
  if %errorlevel% EQU 0 goto mainProcessStart
  if %errorlevel% EQU 1 goto scCheckRunning

  :mainProcessStart
  echo tomcat stopping end at
  TIME /T
  echo mainProcessStart

start /B call D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/bealelaw.bat 1>D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/bealelaw.log 2>&1

start /B call D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/debrauw.bat 1>D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/debrauw.log 2>&1

start /B call D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/lexence.bat 1>D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/lexence.log 2>&1

start /B call D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/osborneclarke.bat 1>D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/osborneclarke.log 2>&1

start /B call D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/rl.bat 1>D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/rl.log 2>&1

start /B call D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/trowers.bat 1>D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/trowers.log 2>&1

start /B call D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/dahl.bat 1>D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/dahl.log 2>&1


    echo bealelaw_Build
    :Begin_bealelaw
    @find /i "BUILD SUCCESSFUL" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/bealelaw.log"
    if %errorlevel% EQU 0 goto Begin_debrauw
    if %errorlevel% EQU 1 goto BUILD_FAILED_bealelaw

    :BUILD_FAILED_bealelaw
    @find /i "BUILD FAILED" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/bealelaw.log"
    if %errorlevel% EQU 0 goto Begin_debrauw
    if %errorlevel% EQU 1 goto Begin_bealelaw 

    echo debrauw_Build
    :Begin_debrauw
    @find /i "BUILD SUCCESSFUL" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/debrauw.log"
    if %errorlevel% EQU 0 goto Begin_lexence
    if %errorlevel% EQU 1 goto BUILD_FAILED_debrauw

    :BUILD_FAILED_debrauw
    @find /i "BUILD FAILED" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/debrauw.log"
    if %errorlevel% EQU 0 goto Begin_lexence
    if %errorlevel% EQU 1 goto Begin_debrauw 

    echo lexence_Build
    :Begin_lexence
    @find /i "BUILD SUCCESSFUL" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/lexence.log"
    if %errorlevel% EQU 0 goto Begin_osborneclarke
    if %errorlevel% EQU 1 goto BUILD_FAILED_lexence

    :BUILD_FAILED_lexence
    @find /i "BUILD FAILED" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/lexence.log"
    if %errorlevel% EQU 0 goto Begin_osborneclarke
    if %errorlevel% EQU 1 goto Begin_lexence 

    echo osborneclarke_Build
    :Begin_osborneclarke
    @find /i "BUILD SUCCESSFUL" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/osborneclarke.log"
    if %errorlevel% EQU 0 goto Begin_rl
    if %errorlevel% EQU 1 goto BUILD_FAILED_osborneclarke

    :BUILD_FAILED_osborneclarke
    @find /i "BUILD FAILED" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/osborneclarke.log"
    if %errorlevel% EQU 0 goto Begin_rl
    if %errorlevel% EQU 1 goto Begin_osborneclarke 

    echo rl_Build
    :Begin_rl
    @find /i "BUILD SUCCESSFUL" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/rl.log"
    if %errorlevel% EQU 0 goto Begin_trowers
    if %errorlevel% EQU 1 goto BUILD_FAILED_rl

    :BUILD_FAILED_rl
    @find /i "BUILD FAILED" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/rl.log"
    if %errorlevel% EQU 0 goto Begin_trowers
    if %errorlevel% EQU 1 goto Begin_rl 

    echo trowers_Build
    :Begin_trowers
    @find /i "BUILD SUCCESSFUL" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/trowers.log"
    if %errorlevel% EQU 0 goto Begin_dahl
    if %errorlevel% EQU 1 goto BUILD_FAILED_trowers

    :BUILD_FAILED_trowers
    @find /i "BUILD FAILED" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/trowers.log"
    if %errorlevel% EQU 0 goto Begin_dahl
    if %errorlevel% EQU 1 goto Begin_trowers 

    echo dahl_Build
    :Begin_dahl
    @find /i "BUILD SUCCESSFUL" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/dahl.log"
    if %errorlevel% EQU 0 goto start_Tomcat7-28
    if %errorlevel% EQU 1 goto BUILD_FAILED_dahl

    :BUILD_FAILED_dahl
    @find /i "BUILD FAILED" "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/dahl.log"
    if %errorlevel% EQU 0 goto start_Tomcat7-28
    if %errorlevel% EQU 1 goto Begin_dahl 

  :start_Tomcat7-28
  echo starting_Tomcat7-28
  echo Please start Tomcat7-28
  net start Tomcat7-28

  exit

在回复查询时发布的... bealelaw bat:

cd\ D:
cd Projects 
cd Collaborate 
cd Branches 
cd R3_1_3 
cd deployment 
call ant autoUpgrade_with_Batch -noinput -Dproperty.file=D:\Projects\properties\Collaborate\collabdev1\prod.properties -Dversion="3.1.3 app10.dev t7-28" -DstartLableName=3.1.3 -DendLableName=3.1.3 -DdryRunLable=y 
exit 

2 个答案:

答案 0 :(得分:1)

如果这个日志文件

 "D:\Autodeployment/MultipleDeployment/Tomcat7-28_app4.sg1_18_01_2014_102046/bealelaw.log"

不包含BUILD SUCCESSFULBUILD FAILED,那是

唯一的时间
goto Begin_bealelaw

将被执行,它将进入无限循环。

答案 1 :(得分:0)

ISTM正在动态创建此批次,而不是提供适当的参数(例如,所需的日期字符串)。

您确定创建过程是否已完成并在调用文件之前将其关闭?