Skip navigation
All Places > Licensing and Installation > Blog > 2013 > November
2013

A few weeks ago we showed you a handy shortcut to quickly access the environment variables on your machine:

 

Tip of the Week: Directly Access Environment Variables With a Shortcut.

 

This week we'll explore a related topic of how to change the environment for a single program session on Windows, via a simple batch script.

 

Two examples of why you might want to tailor the environment for a single session, each followed by a sample two-line script:

 

Example #1:

You want to change the MGLS_LICENSE_FILE to point to a different license server (1717@MyDxDserver) when you launch only DxDesigner, and have all your other Mentor applications use the current value that is stored in the environment variable.


Batch script example (make sure the file ends in ".bat" otherwise it won't execute when you run it):

 

set MGLS_LICENSE_FILE=1717@MyDxDserver
start C:\MentorGraphics\9.5PADS\SDD_HOME\wv\win32\bin\viewdraw.exe

 

When you double-click on the .bat (batch) file the MGLS_LICENSE_FILE environment variable gets changed to 1717@MyDxDserver but ONLY for DxDesigner. No other applications are affected by this change.

 

Notes:

- The "start" keyword means the DOS window goes away as soon as the application appears. You can remove the keyword but then the prompt stays up until you close the application.
- To get the path to "viewdraw.exe" you can right click on the DxDesigner shortcut and copy and paste the "target" field.
- If you want the script to work regardless of which version you are configured for, you can reference the %SDD_HOME% environment variable instead of using an absolute path. In this case you would substitute the second line with "start  %SDD_HOME%\wv\win32\bin\viewdraw.exe". In the 2nd example below we use the %SDD_HOME%.

 

Example #2:

You're running into a DLL conflict between DxDesigner and an application from another software vendor. You want to reduce the PATH variable used by DxDesigner to only the system values plus the required Mentor Graphics folders, while keeping the PATH value the same for all other applications.

 

Batch script example (make sure the file ends in ".bat" otherwise it won't execute when you run it):

 

set PATH=%SDD_HOME%\common\win32\bin;%SDD_HOME%\common\win32\lib;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%MGC_HOME%/bin;%MGC_HOME%/lib

start %SDD_HOME%\wv\win32\bin\viewdraw.exe

Whether you want to deifferentiate multiple processes of the same name or simply see which options were used to start a process, the Windows 7 Task Manager will let you view the command line. This may help in finding which process is using a file or differentiating sessions. The possiblitie are many.

 

To enable the Command Line column:

 

  1. Open Task Manager
  2. Pull-down View> Select Columns
  3. Scoll down and check Command Line
  4. Click OK

 

Your Task Manager will now have a column that will show you the command line used to start the process.

 

2013-11-15_160453.png

System requirements are listed on the Systems Requirements page on Supportnet and you can query system requirements by platform or release with the Platform Query Tool.

In September, I showed you how to more quickly access your Windows environment variables with a keyboard shortcut. But, it gets better.

 

Here's how you can set up a desktop shortcut to directly access your Windows variables:

 

  1. Right-click on your Desktop and select New> Shortcut
  2. For the location of the item paste in %windir%\System32\rundll32.exe sysdm.cpl,EditEnvironmentVariables and click Next
  3. Rename your shortcut Environment Variables and click Finish

 

Now when you double-click this Desktop shortcut, your Environment Variables window will be opened directly.