[Py Windows] User Directory Path

Wolfgang Strobl news2 at mystrobl.de
Sat Apr 30 15:25:46 EDT 2005


"Zoool" <polykrom(at)belcenter(dot)com>:

>Is there a way to know the main directory path of a user session?
>I mean the "C:\Documents and Settings\username" Directory of the user logged 
>into a windows session.

>>> from win32com.shell.shell import SHGetSpecialFolderPath
>>> from win32com.shell.shellcon import CSIDL_PROFILE
>>> SHGetSpecialFolderPath(0,shellcon.CSIDL_PROFILE)
u'C:\\Dokumente und Einstellungen\\wolfgang'


-- 
Wir danken für die Beachtung aller Sicherheitsbestimmungen



More information about the Python-list mailing list