Showing results for 
Search instead for 
Did you mean: 

Double click open part in window explorer


My company use the following batch file to start nx7.5


set UGII_BASE_DIR=C:\Program Files\UGS\NX 7.5
set UGII_ROOT_DIR=C:\Program Files\UGS\NX 7.5\UGII
set NX5_PSB=M:\ugnx7custom
set UGII_SYMBOL_LIBRARY_DIR=M:\ugnx7custom\symbol\
set UGII_CUSTOM_DIRECTORY_FILE=M:\ugnx7custom\toolbar\custom_dirs.dat

set UGII_LOCAL_USER_DEFAULTS=u:\nx75\nx75_user.dpv
set UGII_LOAD_OPTIONS=u:\nx75\load_options.def

set UGII_BITMAP_PATH=M:\ugnx7custom\BITMAP
set UGII_PATDIR=M:\ugnx7custom\pattern
set UGII_INITIAL_GRIP_DIR=M:\ugnx7custom\GRIP\


start "tITLE" "%UGII_ROOT_DIR%\"ugraf.exe%*


Using windows 7, i can't double click to open part(i tried open with and pointing to the batch file with no succes, pointing to the standard exe doesn't open it too )

Please advice, thx.


Re: Double click open part in window explorer

Siemens Phenom Siemens Phenom
Siemens Phenom


Does it get far enough along to generate a log file?


I don't see UGS_LICENSE_SERVER defined in your .bat file - is it defined at the system (or user) level?  If not, you might want to add it to see if that helps.


Re: Double click open part in window explorer

Esteemed Contributor
Esteemed Contributor

I'd do the following

1) Make sure no "echo off" exists in the .BAT - if it does, comment it out

2) Add a "Pause" after all the "Set" commands, also after the "Start"


If that doesn't help...

- Open up a command prompt window

- find a PRT file

- run  the .bat with the part as a parameter, i.e.

c:\> C:\path\batfile.bat D:\path\filename.prt

 (substituting drives/paths as needed)

You SHOULD get an error message at some point


Another test:

all the "set" commands

-open sommand prompt

- do a "DIR [right side of set command]"


e.g. if set is


do a

DIR M:\path


make sure all drives are mapped and paths correctly defined.  I would use cut/paste instead of typing in the path to prevent un-intentionally fixing issues...

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled

Re: Double click open part in window explorer


Checked all the path, no problem.


I wonder why not use start "tITLE" "%UGII_ROOT_DIR%\ugraf.exe"(i tried this and it can open the nx program too) for the last line, what is the %* means for(not really familiar with cmd symbol)?


Still, i can't use open with to open part with the batch together.

Using C:\batchPath.bat C:\partPath.prt result in the  start "tITLE" "%UGII_ROOT_DIR%\ugraf.exe" concatenate with the C:\partPath.prt, which won't work.


There must be a UG way to use cmd to open the prt, something like C:\xx\ugraf.exe -open C:\xx.prt , no?

Re: Double click open part in window explorer

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

why do you need to use a batch to start NX?

You can set those variables in the ugii_env.dat (that's what the file's for).

That way the standard double click of the NX part file will launch the router to start NX with your part file and pick up the variables you've set.


Anthony Galante, Senior Support Engineer
24 versions of NX installed: NX4 to NX12, plus TC11.2

Re: Double click open part in window explorer


Well, company policy so i don't want to mess around with the environment variable and registry.

I had tried the standard exe without using batch file , pointing "open with" to the ugraf.exe in my local program file disk, yield same result(UG started, without any part being opened).

Re: Double click open part in window explorer

Esteemed Contributor
Esteemed Contributor

In the NX documentation under Home => Fundamentals => Customizing NX => Launching NX => Windows platform you will find the command line switches available.


%* is the placeholder for all arguments submitted to the batch file.


Your posted code doesn't have a space between ugraf.exe and %*, so that is your main problem here.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 ( | TcVis 10.1
Development: VB.NET, Tcl/Tk Testing: NX12.0 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink

How to Get the Most from Your Signature in the Community