Oct 18, 2010 0
How To Set Environment Variable When Debugging Using Microsoft Visual Studio 2008
Set up project properties environment variable
I am new to microsoft windows visual studio 2008 IDE , Was looking for How to set environment variables when debugging in Visual Studio?
My project is in c/c++ windows console application.
Set Environment Variables in VS2008
Here are few simple steps to add environment variable.
- Open your project.
- Go to Project>Properties or pres Alt+F7
- Under Configuration Properties>Debugging, edit the ‘Environment’ value to set environment variables.
I wanted to set and add the directory “C:\Program Files\Hummingbird\Connectivity\13.00\Exceed” to the path when debugging app X applications, set the ‘Environment’ value to
PATH=%PATH%;C:\Program Files\Hummingbird\Connectivity\13.00\Exceed;C:\Program Files\Intel\Compiler\Fortran\10.1.021\IA32\Bin
And done.
Set System Wide Environment Variables in Windows PC
Other way to set up this is using system wide environment variable.
- Right click “My Computer”, Select properties
- Select the “advanced” tab
- Click the “environment variables” button
- In the “System variables” section, add the new environment variable that you desire
- “Ok” all the way out to accept your changes
Note : Visual Studio 2003 doesn’t allow you to set environment variables for debugging. In this case one can use _putenv function.
source – Windows Sysinternals: Documentation, downloads and additional resources
Unix has two primitives: 
Popular Discussion Here