Troubleshooting
Problem
This technote contains a batch file that can be used to launch Rational Robot GUI scripts.
Resolving The Problem
Rational Robot has a command-line interface (CLI). It allows unattended execution of script files using a scheduler. The interface is fullly documented within Rational Robot online help, under the topic "Rational Robot Command-line Options".
The following is an example on how to control the execution of the scripts with this method. To use this batch copy it into a text file and save it with, for example, the name rbtcmd.bat. The usage is: rbtcmd.bat <script_name> <user_name> <project_fullpath>.
Some information about it:
1. the first section describes exit codes that can be trapped from executing a Robot script. For instance, if the script executes successfully, then Robot returns the code 0 (zero).
2. the "if" statement tells the batch to skip the execution and display the syntax it expects in case the required number of parameters is missing.
3. once this verification is made successfully, the command is executed that starts the script.
4. the fourth section checks the return code of the execution of the script, and depending on its value, it echoes, that is displays, a message to the MSDOS console.
@echo off
'1.
REM --------------------------------------------
REM 0 Script Passed
REM -1 Script Failure
REM -2 VP failure
REM -3 Script Compilation failure
'2.
if "%1" == "" goto usage
'3.
rtrobo.exe %1 /user %2 /project %3 /play /build "Build 1" /NoLoginServices /logfolder Default /log %1 /close
REM
REM
REM rtrobo.exe <script name> /user <user name> /project <project name> /play
REM
REM
REM /user <user name>
REM /password <password>
REM /project <project name>
REM /logfolder <folder name>
REM /log <logname>
REM /NoLog - no logging.
REM /play - to play a script
REM /close - to close after playing
REM
REM
'4.
if errorlevel 0 goto ret0
if errorlevel -1 goto ret1
if errorlevel -2 goto ret2
if errorlevel -3 goto ret3
goto retunk
:ret0
echo returned 0. Success.
goto end
:ret1
echo returned -1. Script Failed.
goto end
:ret2
echo returned -2. VP Failed.
goto end
:ret3
echo returned -3. Script Compilation Error.
goto end
:retunk
echo returned unknown
goto end
:usage
echo "Usage: rbtcmd.bat <script> <user> <project>"
:end
Was this topic helpful?
Document Information
More support for:
Rational Robot
Software version:
2003.06.00
Operating system(s):
Windows
Document number:
76911
Modified date:
16 June 2018
UID
swg21173550