CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Anyone know how to set command/system variables

    I'm trying to set a system variable from a C++ program, the same way SET VARIABLE= will do in dos.


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Anyone know how to set command/system variables

    Check out:

    SetEnvironmentVariable()
    GetEnvironmentVariable()

    Regards,

    Paul Mckenzie


  3. #3
    Guest

    Re: Anyone know how to set command/system variables

    Paul,

    I found Get/SetEnvironmentVariable() are only good while the thread of the program is running - once the program ends, the command level variable settings are reset. Do you have any ideas on how to return/set a command variable (ie. errorlevel) which persist after the c+ program terminates?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured