A few weeks ago we showed you a handy shortcut to quickly access the environment variables on your machine:
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:
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.
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.
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):