Changing the path on Win2k/XP

Peter Hansen peter at engcorp.com
Tue Jun 11 01:31:31 EDT 2002


Bjorn Pettersen wrote:
> 
> 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...)

I don't think there is.  Generally speaking on most platforms 
with the PATH concept, you can't change it from within a process
(I guess since that could completely screw up the calling process'
environment).

You can play tricks.  Since a batch file (or .cmd) can
change the PATH, call the deployment script from a 
.cmd file which subsequently calls a SETPATH.CMD type
of file.  In your deployment script, modify that file
so that when it is called after your script exits, the
path gets changed.

Alternatively, install the DLL to a directory already in
the path, such as the SYSTEM32 folder or whatever...

Or just count on the fact that DLLs are found in the
same directory as the application if they are installed
there.

For that matter, on Win2K does the system really look
only to the path for loading DLLs?  I would think there
are places in the registry where pointers to these things 
are supposed to be installed.

Do you really need to install a DLL all by itself into
a new folder and add it to the path?  Why?

-Peter



More information about the Python-list mailing list