Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Setting Windows Environment Variables programmatically (win32/mfc) [modified]

Setting Windows Environment Variables programmatically (win32/mfc) [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharpcomquestionworkspace
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Manu Dev
    wrote on last edited by
    #1

    Hi, I came across an article about setting windows Environment variables from within a program. http://www.codeproject.com/KB/system/EnvMan.aspx[^] However it uses .net library's Environment class to do it. Is there some way to do it using win32/mfc native code?:confused: I tried the _putenv() and getenv() functions but it seems they affect the process which makes these calls only. The changed values do not get reflected on the system level. :doh: Is there any other way to achieve this?

    only dead fish swim with the stream

    modified on Sunday, May 25, 2008 8:38 AM

    J 1 Reply Last reply
    0
    • M Manu Dev

      Hi, I came across an article about setting windows Environment variables from within a program. http://www.codeproject.com/KB/system/EnvMan.aspx[^] However it uses .net library's Environment class to do it. Is there some way to do it using win32/mfc native code?:confused: I tried the _putenv() and getenv() functions but it seems they affect the process which makes these calls only. The changed values do not get reflected on the system level. :doh: Is there any other way to achieve this?

      only dead fish swim with the stream

      modified on Sunday, May 25, 2008 8:38 AM

      J Offline
      J Offline
      Jijo Raj
      wrote on last edited by
      #2

      Check this one - http://www.codeguru.com/cpp/w-p/win32/tutorials/article.php/c10849/[^] Regards, Jijo.

      _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

      M 1 Reply Last reply
      0
      • J Jijo Raj

        Check this one - http://www.codeguru.com/cpp/w-p/win32/tutorials/article.php/c10849/[^] Regards, Jijo.

        _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

        M Offline
        M Offline
        Manu Dev
        wrote on last edited by
        #3

        thanks Jijo raj. this seems to be exactly what i was looking for.

        only dead fish swim with the stream

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups