Saving Files Under Windows

Tim Golden tim.golden at
Tue Jun 17 13:18:29 CEST 2003

Tim Golden <tim.golden at> wrote in message news:<mailman.1055781148.14465.python-list at>...
> achrist at> This looks to be exactly what I need, if I can get
> it to work ...
> achrist at> Are these not portable to WinNT?  On NT 4.0 SP6,  I
> get:
> [snip error messages]
> Ahh. I rather thought that the win32 shell stuff was universal (on win32, at
> least). I don't have an NT4 box here, so I'll have to try it when I get
> home. Can anyone else confirm, or cast light on this?

Answering myself...

WinNT (and maybe Win95) don't support SHGetSpecialFolderPath directly;
instead, you have to use SHGetSpecialFolderLocation and then
SHGetPathFromIDList. If you wish, have a butchers at my winshell
module (, a
convenience wrapper round these sort of things. If nothing else, you
can look at the code and see what I'm talking about.

Since Win2K (and maybe Win98) also support the two-level SHGet...,
I've recoded my module to use that rather than try to do
platform-specific juggling, which smacks of browser-sniffing a little
too much for my liking.


More information about the Python-list mailing list