×
Menu
Index

Using TBOSDT Commands from a Script

 
A TBOSDT script consists of a text file that contains one or more commands, listed in the order to be executed. Comments can be included in the script by putting a semi-colon (;) at the beginning of the line. Blank lines can also be used to improve readability when viewing the file. A TBOSDT script can be executed in two ways:
 
From the OS command line:
Start TBOSDT with the name of the script file as the command line parameter (e.g. tbosdt myscript.run or tbosdt myscript.tbs). When all commands have been executed, TBOSDT will return to the OS command prompt, and all mounted drives and open files will be automatically unmounted or closed. The exception to this is when the INTERACTIVE or STAY command is used within the script. The INTERACTIVE command will cause the script to stop executing at that point, and leave you in interactive mode within TBOSDT. Any drives mounted at that point will remain mounted, any registry files opened will remain open, and commands can be executed manually from the TBOSDT prompt. To leave interactive mode, type EXIT at the prompt. This will cause the running script to continue executing the remaining commands (if any) in the script, and then exit normally to the OS command prompt. The STAY command also switches to interactive mode but only once the script has completed.
 
By using the RUN command:
The RUN command can be used to execute a script from interactive mode or from another script. The RUN command syntax is simply RUN <script>. The RUN command will execute the script, and then return to interactive mode, or to the calling script. When using the RUN command from interactive mode, any drives mounted, registry files opened, or registry keys opened will remain that way when the script terminates, unless they have been explicitly unmounted or closed by the script. Starting with TBOSDT version 1.42, if the script to be run has a .TBS (case insensitive) extension, it will be launched as a TBScript RUNTBS instead of a normal TBOSDT script.
 
If an error is encountered while executing a script, an error message will be displayed on the console, and the script will terminate. The error message will indicate the line number of the script where the error was encountered, along with some specifics about the nature of the error.