What are the switches for msbatch?


 Product:MicroStation
 Version:V8 2004, XM, V8i, CONNECT
 Environment:N\A
 Area:Batch Processing
 Subarea:N\A

Problem

What are the switches for msbatch?

Solution

All of MicroStation's command line switches can been seen by typing “microstation -?” from dos prompt in \Program Files\Bentley\Program\MicroStation\ folder.

 

Syntax

@echo off
rem
rem %1 should be the name of the application (ex. msbatch.bat cnvdgn)
rem %2-%9 are other parameters to be passed through to the application
rem
start /wait microstation.exe -wa%1 -i%2 -i%3 -i%4 -i%5 -i%6 -i%7 -i%8 -i%9

The first line just stops the command window from repeating everything in the batch file.
The rem lines are just telling you what it does.
The -wabatchconvert is actually a command line switch sent to MicroStation to tell it to run the MDL application batchconvert.

Note: "start/wait" is a change syntax from the "runwait" command

See the image above for what is returned to the screen when typing "ustation -?"

The -WR switch now specifies _USTN_CONFIGURATION i.e. -wrC:\Bentley\Configuration. In previous versions this pointed to Specifies _USTN_WORKSPACEROOT

You can see by looking at msbatch, it puts "-wa" before the first argument, and "-i" before every other argument. So the only argument that goes to MicroStation tells it to run whatever MDL program you want (like batchconvert) and all the other arguments are ignored by MicroStation and passed to the specified MDL program.

The batch convert MDL application has three command line switches, here's what I think they do:

-nodialog - skips putting up the dialog showing or selecting the batch job.
-nowait - doesn't wait for you to hit the "Process" button before starting the batch job.
-exitdone - when done the batch job, does not keep the status dialog up until you dismiss it.

If you don't use msbatch, you pass the arguments to batchconvert by using the -i leadin:

microstation -wabatchconvert -ithisbatchfile.bcnv -inodialog -inowait

Note: The syntax will change slightly depending on the application that you are running.

For example: The syntax for OpenBuildingDesigner (OBD) would be:

start /wait OpenBuildingsDesigner.exe -wa%1 -i%2 -i%3 -i%4 -i%5 -i%6 -i%7 -i%8 -i%9

You are simply replacing the microstation.exe with openbuildingdesigner.exer in the syntax of your command line.

(For MicroStation V8i and other pre-CONNECT versions)

All of MicroStation's command line switches can been seen by typing “ustation -?” from dos prompt in \Program Files\Bentley\Program\MicroStation\ folder.

Syntax

@echo off
rem
rem %1 should be the name of the application (ex. msbatch.bat cnvdgn)
rem %2-%9 are other parameters to be passed through to the application
rem
runwait ustation.exe -wa%1 -i%2 -i%3 -i%4 -i%5 -i%6 -i%7 -i%8 -i%9

The first line just stops the command window from repeating everything in the batch file.
The rem lines are just telling you what it does.
The -wabatchconvert is actually a command line switch sent to MicroStation to tell it to run the MDL application batchconvert.


Here's what it returned to screen when you type in ustation -?:

Command Line Arguments for ustation.exe:

-DEBUG - Dumps configuration variables to msdebug.txt and exits.
-i - Passes through parameters to INITAPPS.
-O - Does not open any references.
-QP - Specifies password for protected file.
-R - Opens the design file in read-only mode.
-RestoreDefaults - Restore default settings and then exit.
-RestoreDefaultsQuiet - Restore default settings and then exit. No output.
-S - Dumps text in the startup file into the command queue after startup.
-WA - Specifies MDL application to start at MicroStation initialization (same as MS_INITAPP).
-WC - Specifies the configuration file MicroStation will use on startup (for example, -wcC:\Bentley\Workspace\Config\myconfig.cfg).
-WD - Specifies database configuration.
-WI - Specifies interface configuration.
-WP - Specifies project configuration.
-WS - Specifies a configuration variable to be defined (for example, -wsMS_SECURITY_LEVEL=HIGH).
-WU - Specifies user configuration.
-WR - Specifies _USTN_WORKSPACEROOT (for example, -wrC:\Bentley\Workspace\).
-M - Specifies initial model to open.
-help or -? - Displays Command line arguments for Ustation.exe

But as you can see by looking at msbatch, it puts "-wa" before the first argument, and "-i" before every other argument. So the only argument that goes to MicroStation tells it to run whatever MDL program you want (like batchconvert) and all the other arguments are ignored by MicroStation and passed to the specified MDL program.

Just as in MicroStation CONNECT Edition, batch convert MDL application has three command line switches, here's what I think they do:

-nodialog - skips putting up the dialog showing or selecting the batch job.
-nowait - doesn't wait for you to hit the "Process" button before starting the batch job.
-exitdone - when done the batch job, does not keep the status dialog up until you dismiss it.

If you don't use msbatch, you pass the arguments to batchconvert by using the -i leadin:

Ustation -wabatchconvert -ithisbatchfile.bcnv -inodialog -inowait

See Also

Using msbatch for command line processing

Other language sources

 Original Author:Reginald Wallace