I am trying to find out the location of system folders with Python 3.1. For example \"My Documents\" = \"C:\\Documents and Settings\\User\\My Documents\", \"Program Files\"
Here's an alternative win32com approach because WScript.Shell
"special folders do not work in all language locales, a preferred method is to query the value from User Shell folders" (ref):
>>> ID = 48
>>> shapp = win32com.client.Dispatch("Shell.Application")
>>> shapp.namespace(ID).self.path
'C:\\Users\\mattw\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Administrative Tools'
The ID number comes from MSDN ShellSpecialFolderConstants Enumeration. I converted that list to csv for easy use and wrote a short python script demoing that, gist here.
Special thanks to Mr Chimp for starting this off. I relied heavily on his answer and references to get started.