Starting Non-interactive Applications


The DSL Batch program is used to start an application with the DSL environment without needing to use the DSL menu program. Background applications that run at night are prime canidates to use DSL Batch. Another use for DSL Batch is to start NX from the file manager.

Program Invocation

DSL Batch is invoked with the following command:

(Windows) ${DSL_BASE_DIR}\dsl_batch.vbs [--dept <department>] --program <program to run> [<program arguments>]

Arguments surrounded by brakets [ ] are optional arguments.

Argument Meaning

--dept <department> - The directory name under /appl/ugsite of the department to use to set the environment. If this argument is absent, the last department selected by the user in the DSL menu is used.

--program <program to run> - The program executable to actually run

<program arguments> - A list of arguments to pass to the <program to run>, if any.

Starting NX from the File Manager

DSL Batch can be used to setup the file manager to start NX with the DSL environment when a NX part file is double-clicked in it. The command to associate with a NX part file is:

(Win) ${DSL_BASE_DIR}\dsl_batch.vbs --program "${DSL_BASE_DIR}/win/bin/start_nx.bat" "<part file>"

(Win64) ${DSL_BASE_DIR}\dsl_batch.vbs --program "${DSL_BASE_DIR}/win64/bin/start_nx.bat" "<part file>"

Setting File Associations in Windows 7

To set file associations, try the following;

(1) Start->Default Programs->Associate a file type with a program.

(2) Find .prt under Name, then hit "change program".

(3) In some cases the File Type is set to PRT file. You may see the option to

RESTORE the file type.. in this case select RESTORE.

(4) Now the File Type is restored to 'UG Part File'.

(5) select Advanced to change the Open action for .prt file type to be, for DSL double click UG part purpose:

C:\Windows\System32\Wscript.exe "C:\Program Files\nxdslX.Y\assoc.vbs" "%1"

Now user can double click an NX part icon, and NX and part will open in DSL environment with DSL variables.

Setting File Associations in Windows XP

To set file associations, try the following;

(1) Open a Windows Explorer window and select, Tools->Folder Options

(2) Select the File Types tab, and scroll to the PRT Extension.

(3) In some cases the File Type is set to PRT file. You may see the option to

RESTORE the file type.. in this case select RESTORE.

(4) Now the File Type is restored to 'UG Part File'.

(5) select Advanced to change the Open action for .prt file type to be, for DSL double click UG part purpose:

C:\Windows\System32\Wscript.exe "C:\Program Files\nxdslX.Y\assoc.vbs" "%1"

Now user can double click an NX part icon, and NX and part will open in DSL environment with DSL variables.

WINDOWS NOTE: You must use UNIX formatting environment variables in the arguments to -program. This will make sure the variables are evaluated correctly at the appropriate time.