Get Special Folders (ie Desktop location)

Colin Steadman colin.steadman at gmail.com
Wed Dec 1 03:32:53 EST 2004


> 
> You can do that in Python using the pywin32 extensions
> either by using the Wshell objects as you have done:
> 
> <code>
> 
> import win32com.client
> WShell = win32com.client.Dispatch ("WScript.Shell")
> WShell.SpecialFolders ("Desktop")
> 
> </code>
> 
> or by using the shell module from the same package.
> I've got a module which wraps the common ones for
> convenience:
> 
> http://tgolden.sc.sabren.com/python/winshell.html
> 
> but essentially what you're doing is this:
> 
> <code>
> from win32com.shell import shell, shellcon
> 
> shell.SHGetPathFromIDList (
>   shell.SHGetSpecialFolderLocation (
>     0, shellcon.CSIDL_DESKTOP
>   )
> )
> </code>
> 
> TJG


Thank you both!

Col



More information about the Python-list mailing list