Export Files from the Command Line

You can also export files from the command line by using the msbatch.bat file. This is useful when you want to set up an automated script for file export.

Note: To export a file from the command line, you must first add the MicroStation program directory to the Path environment variable.

The format of the command line exporter is

msbatch nwexport_22 [-f] FILE [OUTPUT]

FILE is the name of the MicroStation file you want to export. This is the only required option. The OUTPUT argument enables you to specify the name of the output file.

By default, the exporter only converts files that have been changed since the last time you exported them. This is useful for speeding up exporting a large number of files. If you want to force the exporter to convert all files, use the -f option.

Modify the Path Environment Variable

  1. In the Control Panel, double-click System.

  2. In the System Properties dialog box, Advanced tab, click the Environment Variables button.

  3. In the Environment Variables dialog box, double-click Path under System Variables.

  4. In the Edit System Variable dialog box, add the path to the MicroStation application to the Variable Value field.

    Note: Paths must be separated with a semicolon (;).
  5. Click OK to save the changes and close the dialog boxes.

Use the Command Line to Export Files

  1. Press Windows + R on the keyboard.
  2. Enter the file export command with appropriate arguments, for example msbatch nwexport_22 file.
  3. Press Enter.
  4. In the MicroStation Manager dialog box, select the files you want to export, file extension (NWC), and storage location.
  5. Click OK.