2 rem ********************************************************************
\r
3 rem * File: Command.bat
\r
4 rem ********************************************************************
\r
8 if errorlevel 1 ( echo ^<%error_message%/^> & pause & exit /b )
\r
9 if "%~1" == "1" ( exit /b 21 )
\r
13 rem ********************************************************************
\r
14 rem * Function: Main
\r
15 rem * Calls test functions.
\r
16 rem ********************************************************************
\r
18 echo --- Command.bat %*
\r
19 if "%~1" == "2" ( copy Step2\01\A.txt Step2\Work\A.txt )
\r
20 if "%~1" == "1" ( copy ..\Step1\01\A.txt ..\Step1\Work\A.txt > nul )
\r
24 rem ********************************************************************
\r
25 rem * Function: SetVariables
\r
26 rem ********************************************************************
\r
31 rem ********************************************************************
\r
32 rem * Section: batlib
\r
33 rem ********************************************************************
\r
36 rem ********************************************************************
\r
37 rem * Function: Error
\r
40 rem * "%~1" - Value of setting %errorlevel%.
\r
43 rem * %errorlevel% - %~1. Number type
\r
46 rem * This sets %error_message% variable.
\r
47 rem * This adds %error_ID% variable.
\r
48 rem * This echos each command from %error_ID% was matched %echo_error_ID%.
\r
49 rem ********************************************************************
\r
51 set /A error_ID = %error_ID% + 1
\r
53 set error_message=ERROR errorlevel="%~1" error_message="%~2" error_ID="%error_ID%"
\r
54 rem // "echo %error_message%" cannot execute, if there are "<" and ">" of "<ERROR/>".
\r
56 if "%error_ID%" == "%echo_error_ID%" (
\r
58 echo ===============================================================================
\r
59 echo ^<%error_message%/^>
\r
70 rem ********************************************************************
\r
71 rem * Function: ClearError
\r
78 rem ********************************************************************
\r