Environmental Variables in XP

  • Thread starter Environment Variables
  • Start date
E

Environment Variables

Does anybody know where does Windows XP store environmental variables in
XP? Which file is used for this? I have checked Autoexec.bat and
Config.sys files but they are completely blank. Also, Autoexec.NT and
Config.NT files are also almost blank. Everything is REMed out in the file.

This Microsoft document doesn't say anything about it either:

<http://support.microsoft.com/kb/310519>

I need to replicate it in Windows7 so that I can run Apache, MySQL and
PHP as "localhost" for development work on it. Of course I can set
these manually but I want to copy and paste them in Win7 to make sure
everything is identical to XP so that any problems can be documented
correctly.

--
 
N

Nil

Does anybody know where does Windows XP store environmental
variables in XP? Which file is used for this?

The Registry.

I believe autoexec.nt and config.nt only come into play when you start
up a command shell session. Nothing in them applies to the system as a
whole.
 
V

VanguardLH

Environment said:
Does anybody know where does Windows XP store environmental variables in
XP? Which file is used for this? I have checked Autoexec.bat and
Config.sys files but they are completely blank. Also, Autoexec.NT and
Config.NT files are also almost blank. Everything is REMed out in the file.

This Microsoft document doesn't say anything about it either:

<http://support.microsoft.com/kb/310519>

I need to replicate it in Windows7 so that I can run Apache, MySQL and
PHP as "localhost" for development work on it. Of course I can set
these manually but I want to copy and paste them in Win7 to make sure
everything is identical to XP so that any problems can be documented
correctly.

They're stored in the registry. I could look for you but you can do
this yourself. Add some unique string to your system PATH environment
variable (not within some command shell you open but in the global PATH
variable). Now go do a search in the registry on that string. Bingo,
you found where it's defined.

You better compare the PATH values on your XP host to its definition on
your 7 host. They may not be the same. Some entries are for software
that you installed that may not be installed on the other host. Some
entries may be for OS-specific path that are now different under
different versions of the OS. You need to see what entries at listed in
the XP version of PATH to see which of those are missing in the 7
version of PATH - and then decide which entries to migrate. Not all of
them in the XP PATH may be applicable in the 7 PATH. If you copy the XP
PATH over the value of the 7 PATH then you could lose entries that are
needed in the 7 PATH that are specific only to that OS or to the apps
installed only on your Windows 7 host.
 
G

glee

Environment Variables said:
Does anybody know where does Windows XP store environmental variables
in
XP? Which file is used for this? I have checked Autoexec.bat and
Config.sys files but they are completely blank. Also, Autoexec.NT and
Config.NT files are also almost blank. Everything is REMed out in the
file.

This Microsoft document doesn't say anything about it either:

<http://support.microsoft.com/kb/310519>

I need to replicate it in Windows7 so that I can run Apache, MySQL and
PHP as "localhost" for development work on it. Of course I can set
these manually but I want to copy and paste them in Win7 to make sure
everything is identical to XP so that any problems can be documented
correctly.


They are stored in the Registry at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment

As Vanguard mentioned, not all entries there are going to be the same in
both operating systems.... also some of the values in that key are
machine-specific hardware references.

You can edit the Environmental Variables in Windows via the System
Control Panel:

In XP, right-click My Computer and click Properties.
In the System Properties window, click the Advanced tab, then click the
Environment Variables button.
Select a variable and click the Edit button, or click the New button to
create a variable.

In Windows 7, right-click My Computer and click Properties.
Click Advanced System Settings link in the left column.
In the System Properties window click the Environment Variables button.
Select a variable and click the Edit button, or click the New button to
create a variable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top