BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get and Set Environment varialbes

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Douglas Stites
Guest





PostPosted: Tue Apr 24, 2007 8:25 pm    Post subject: Get and Set Environment varialbes Reply with quote



BSD2006, C++ personality

I want to get and set windows environment variables

getenv and putenv don't work (they work for cmd.exe, but not for windows
unless I am doing something wrong.

thanks in advance
Back to top
Alan Bellingham
Guest





PostPosted: Tue Apr 24, 2007 8:48 pm    Post subject: Re: Get and Set Environment varialbes Reply with quote



"Douglas Stites" <doug (AT) stites (DOT) org> wrote:

Quote:
BSD2006, C++ personality

I want to get and set windows environment variables

getenv and putenv don't work (they work for cmd.exe, but not for windows
unless I am doing something wrong.

thanks in advance

You know that those settings last only to the end of the current
process? So, if you expect one program to effectively inject environment
variables into Windows as a whole, you're out of luck.

(Changing PATH would have been an especially bad idea for security
reasons.)

If you want to do this, then make sure that your program does the
setenv() stuff, runs whatever else you want to run, and then terminates
after that has finished.

Alan Bellingham
--
ACCU Conference 2008: 2-5 April 2008 - Oxford (probably), UK
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.