Windows and My Documents

Bob Greschke bob at passcal.nmt.edu
Thu Jun 3 12:50:28 EDT 2010


On 2010-06-03 09:57:11 -0600, Tim Golden <mail at timgolden.me.uk> said:

> On 03/06/2010 16:39, Bob Greschke wrote:
>> How do I do a "listdir" (or whatever I need to use) of the Desktop on a
>> Windows machine and have "folders" like My Documents show up in the result?
>> 
>> I'm specifically trying to get a link to VMWare Shared Folders to show
>> up so I can navigate to files in OSX from WinXP running in VMWare, but
>> My Documents doesn't show up, either.
>> 
>> The docs for listdir says it doesn't follow links and I don't think I
>> want to tell os.walk to followlinks as that could be zillions of files.
> 
> Depends exactly what '"folders" like My Documents' means (since I'm unfamiliar
> with VMWare Shared Folders) but you almost certainly want to use the Shell
> functions to walk the shell from the Desktop root. There was a short thread
> recently about it which I'll try to dig up (digs...):
> 
>    http://mail.python.org/pipermail/python-win32/2010-May/010475.html
> 
> TJG

Well, My Documents is not a normal folder.  It's not the same as 
right-clicking and creating a new folder.  I don't know what it is, 
exactly.  VMWare Shared Folders seems to be a normal sort of link to 
'\\.host\Share Folders', but not quite, however, beyond that I'm not 
sure what it is.  If I create Shortcuts to My Documents and VSF those 
show up with listdir, but I cannot follow them; Python does not think 
they are directories, which they aren't  (they show up from listdir as 
'Shortcut to My Documents.lnk', for example).

I'll take a look at the link above.  Thanks!

Bob




More information about the Python-list mailing list