SHGetSpecialFolderLocation Question?

Dave Brueck dave at pythonapocrypha.com
Mon Jan 20 17:16:36 CET 2003


On Mon, 20 Jan 2003, kumar wrote:

> The following python call always return "DESKTOP" as my personal
> directory, where as it is a directory named "personal". Can some help
> me with this?
>
> Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
> Type "copyright", "credits" or "license" for more information.
> >>> from win32com.shell import shell, shellcon
> >>> IDLList= shell.SHGetSpecialFolderLocation(shellcon.CSIDL_PERSONAL,
> 0)
> >>> print "my_personal_dir =", shell.SHGetPathFromIDList(IDLList)
> my_personal_dir = C:\WINNT\Profiles\kumar\DESKTOP
> >>>

Hi Kumar,

I think the problem is that the first argument to
SHGetSpecialFolderLocation is supposed to be hwndOwner:

SHGetSpecialFolderLocation(0, shellcon.CSIDL_PERSONAL)

HTH,
-Dave





More information about the Python-list mailing list