The $HOME of Windows.
Mark Hammond
MarkH at ActiveState.com
Tue Sep 25 19:40:16 EDT 2001
Markus Schaber wrote:
> Hi,
>
> Curtis Sandoval <csandoval at fourthought.com> schrub:
>
>
>>One possibility for this is the %USERPROFILE% variable which should be
>>set
>>in the system environment. This will map to the 'Documents and
>>Settings\username' directory on NT5 and the '\Profiles\username' on
>>NT4,
>>which are functionally equivalent directories. Win95, 98, etc are not
>>really designed for multiple user capability, so you if you want to
>>support these operating systems you will probably want to just put
>>your config
>>settings in 'Program files\programname\username' to be more universal.
>> This will also work on NT4 and NT5, so this may simplify your task.
>>
>
> This is not such a good idea, because:
>
> - It requires write access for all potential users to the programm
> installation directory
>
> - It mangles program and user data storage, thus making backups and
> re-installations more difficult
The "correct" way of doing this is to use
win32com.shell.shell.SHGetFolderLocation and/or
win32com.shell.shell.SHGetSpecialFolderLocation
Mark.
More information about the Python-list
mailing list