Visual Studio Developer Center >
Visual Studio Forums
>
Visual Studio Extensibility
>
How to check out all the environment variables in visual studio
How to check out all the environment variables in visual studio
If I start the visual studio by devenv /useenv, visual studio will take in all the environment variables already set in the cmd shell. And there are tons of other ways to set environment variables in visual studio. What if after that, I want to check the value of a specific environment variable or all of them just I would do in a cmd shell by typing "set" or "set *". For example, if I do set FrameworkSDKDir in a visual studio command prompt, it will show the directory value. How may I do the similar thing in visual studio since some environment variables are only valid inside visual studio but not the cmd shell from which it is opened.
Thanks
Patrick- Moved byFigo FeiMSFTFriday, June 26, 2009 3:36 AM (From:Visual Studio Setup and Installation)
Answers
- Hello Patrick,
Do you mean check the environment variables for devenv process when starting with /UseEnv?
We can use Process Explorer to read environment variables for each running process. Doulbe click the process, and select the Environment in the pop-up dialog, the environment variables will show.
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Thanks,
Rong-Chun Zhang
Please mark the replies as answers if they help and unmark if they don't.
Welcome to the All-In-One Code Framework, a sample code project owned by the MSDN Forum Support team!- Marked As Answer byRong-Chun ZhangMSFT, ModeratorFriday, July 03, 2009 9:15 AM
- To print to the build log:
vc++
In the project property pages select the tab Configuration Properties > Build Events > Post-Build Event and add the command "set" to the Command Line text box.
c#
In the project properties, select tab Build Events and add the command "set" to the Post-build event command line text box.- Marked As Answer byRong-Chun ZhangMSFT, ModeratorTuesday, August 04, 2009 10:31 AM
All Replies
- Hello Patrick,
Do you mean check the environment variables for devenv process when starting with /UseEnv?
We can use Process Explorer to read environment variables for each running process. Doulbe click the process, and select the Environment in the pop-up dialog, the environment variables will show.
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Thanks,
Rong-Chun Zhang
Please mark the replies as answers if they help and unmark if they don't.
Welcome to the All-In-One Code Framework, a sample code project owned by the MSDN Forum Support team!- Marked As Answer byRong-Chun ZhangMSFT, ModeratorFriday, July 03, 2009 9:15 AM
- Wonderful. Was looking for an option in VS2003 to print all the environment variables to the build log, which I haven't yet found in vs2008. Anyway, this works better. Thanks -Patrick
- To print to the build log:
vc++
In the project property pages select the tab Configuration Properties > Build Events > Post-Build Event and add the command "set" to the Command Line text box.
c#
In the project properties, select tab Build Events and add the command "set" to the Post-build event command line text box.- Marked As Answer byRong-Chun ZhangMSFT, ModeratorTuesday, August 04, 2009 10:31 AM
- Good idea! Thanks for your sharing, Mark.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. - Hower what about "special" variables used within VS. E.g. I cannot see "IntDir" or "ProjectDir" inside the Environment, but I can use these inside my Project Properties. I would I get a listing of these, and what they are set to ?


