Environment Variables Re-Visited

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bill Armitage (BillArmitage_at_discussions.microsoft.com)
Date: 09/03/04


Date: Fri, 3 Sep 2004 08:13:03 -0700

Ken and Tony responded correctly to my previous enquiry re Environment
Variables.
But I really did not pose the question that I meant to.I simply asked if it
was possible to programmatically create an Environment Variable using VB and
the reply I received did create such a variable and its value could be seen
by a child process. But, on exit from the parent process the created
Environment Variable was wiped from the Table of Environment Variables. I
really want to cretae a 'permanent' environmental variable that can be creted
by one parent process and subsequently read by another process not spawned by
the creator process. Is this possible? Message 9 from the 12 thread
message that I was directed to implies that this is not possible. It
appears that each parent process gets its own copy of the Environmental Table
and anything that it does to this table idoes not affect the original. If
this is so then I must look for another solution. (I could pass the
information via a file - but I am trying to avoid this solution).
Anyway, many thanks to everyone who has considered this problem.
Bill Armitage



Relevant Pages

  • Re: RE: How to manipulate environment variables in parent process?
    ... I make the child manipulate the environment table in the parent? ... If you can get the parent process to cooperate, though, it is able to ... your Perl program, then use that output to set environment variables, ...
    (perl.beginners)
  • Confusion on DosStartSession and environment
    ... I am trying to start a child process with some environment, ... additional variables set ) in the parent process. ...
    (comp.os.os2.programmer.misc)
  • Re: Confusion on DosStartSession and environment
    ... the environment of the parent process and some that I have set additional variables set ) in the parent process. ... But if I print out the same information in the child, it only contains the very first entry, i.e. ...
    (comp.os.os2.programmer.misc)
  • Re: Environment Variables Re-Visited
    ... Ken and Tony responded correctly to my previous enquiry re Environment ... on exit from the parent process the created ... versions of the Windows OS implement different methods for maintaining system wide ... There are two Microsoft command line utilities, Winset and Setx, that you can probably ...
    (microsoft.public.vb.enterprise)
  • Re: ENV variable NOT recognized ! Reboot really necessary ????
    ... this will only change the environment block for new processes created *after* the change. ... Existing processes will keep on using their current environment block, which is the same as it was before you made the change. ... But an application needs to be written to explicitly do this; there's no mechanism in the operating system to universally update environment variables on the fly for running processes. ... For example, say you had a command prompt open, and you run a SET command to display the current variables. ...
    (microsoft.public.windowsxp.help_and_support)