Changing the path on Win2k/XP

David LeBlanc whisper at oz.net
Tue Jun 11 02:48:00 EDT 2002


You should be able to modify the path on Win2k/XP by modifying the
associated registry key(s). There is one for the "system" environment one
for the "per user" environment. This won't take effect for the current
process though, but only for new ones (at least comd.exe processes).

Take a look in (changes depending on user logged in):
	HKEY_CURRENT_USER\Environment
and:
	HKEY_LOCAL_MACHINE\SYSTEM\Current Control Set\Control\Session
Manager\Environment	HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session
Manager\Environment	HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Session
Manager\Environment

Of the 3 in HKLM\SYSTEM, I think only "Current Control Set" is relevent.

You can modify these with the _winreg package ("import _winreg"). BE VERY
CAUTIOUS! Incorrect modifications of your registry can render your machine
unusable and possibly requiring an OS reinstall. There is a procedure for
creating a backup copy of your registry and a backup disk and I suggest you
do both until you are comfortable with what you're doing.

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Bjorn Pettersen
> Sent: Monday, June 10, 2002 21:07
> To: python-list at python.org
> Subject: Changing the path on Win2k/XP
>
>
> Is there a way to change the path on Win2k/XP through Python? (I'm
> trying to write a .dll deployment script for our production department,
> and I'd like to give them a "one button" install...)
>
> -- bjorn
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list