Get and Set Environmental Variable RRS feed

  • Question

  • Hello,

    I am Renu Kumari Sharma.

    I am working on a project in our company that requires o edit the value of user variables under environment variables dialog.

    I uses SetEnvironmentVariable() API and GetEnvironmentVariable() API to set and get the value respectively in my project which uses VC++ setting in VS2010 with service pack 1 ( valid license ).

    below are my list of question and doubts:

    1. When I debug using visual studio2010 I get the value properly whatever I am seting using SetEnvironmentVariable() but the user variables under environment variables dialog changes are not shown. ( the problem doesnot end here )

    2. When I run my executable ( double click ) the executable wokrs with the value which is set under environment variables dialog and not which is set by APIs. I want my executable to run with the value which i set or I want APIs which set the value simlutaneously in environment variables dialog also and solves the issue.

    Is there a way out?

    Thursday, October 3, 2013 9:22 AM


  • Renu,

    Sorry but you have posted to a forum that deals exclusively with question/issues about customizing and programming Microsoft Project, a planning and scheduling application. I suggest you delete this post and find a forum that deals with C++. Failing that, start with this forum:



    • Marked as answer by Renu K Sharma Friday, April 11, 2014 5:26 AM
    Thursday, October 3, 2013 3:09 PM