in reply to Evironment variable on Win32 machines

An important note: In NT4 if you set an environment variable through the System Control Panel, it will not be available in DOS sessions until you logout and login again. I discovered this when I was doing a weird hand tweaked install of Indigo Perl (don't ask).

Update Re: tye Perhaps it is peculiar to how our boxes are set up here, but clicking OK and/or Apply in the System CP has no effect on any current (no surprise there) or new command prompt windows (unless you logout/in). tye is right when he says a new window should have the proper environment settings. None of my employer's machines shows the reasonable behavior tye speaks of. YMMV. Don't you just love Windows.


TGI says moo

  • Comment on Re: Evironment variable on Win32 machines

Replies are listed 'Best First'.
(tye)Re2: Evironment variable on Win32 machines
by tye (Sage) on Jun 20, 2001 at 23:33 UTC

    Actually, you don't have to log out and back in again. You can make the changes in the Registry however you like. Then go to the Control Panel -> System (-> Advanced) -> Environment. Click OK. Now the Explorer shell has been told to pick up the new environment settings (but the Service Control Manager hasn't, but that shouldn't matter for most cases). Now open a new Command Prompt window and the environment should reflect the changes. Command Prompt windows opened before the changes won't see the changes.

    Update: Regarding

    clicking OK and/or Apply in the System CP has no effect on any current (no surprise there) or new command prompt windows
    It sounds like you may not have followed the directions. You have to select the "Environment" tab (in WinNT) and then click "OK" ("Apply" won't be an option). In Win2K, you have to select the "Advanced" tab, open the "Environment" dialog, then click "OK".

    One more thing, you can't start a new command prompt from an old command prompt or it will inherit its environment from that command prompt instead of from the Explorer shell.

    I've just reverified this behavior for both WinNT and Win2K (starting the new command prompt window from the "Start" menu).

            - tye (but my friends call me "Tye")