On May 20, 2:45 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Bob Greschke wrote: > > This MUST have been asked before, but I can't seem to Google the right > > thing. How can I get a list of drives on a Windows box, like ["C:\", > > "D:\"], like I can if I do something like listdir("/Volumes") on a Mac? > > A couple of options to get the ball rolling: > > 1) win32api.GetLogicalDriveStrings()
I gave this a go to see how it worked and ti gave me this: 'A:\\\x00C:\\\x00D:\\\x00G:\\\x00I:\\\x00L:\\\x00P:\\\x00Q:\\\x00R:\\ \x00U:\\\x00X:\\\x00Y:\\\x00Z:\\\x00' Not exactly what I expected. Do I have to parse out the "\\\x00" myself or is there an information level switch I should add? > > 2)http://timgolden.me.uk/python/wmi_cookbook.html#find-drive-types This works as advertised. I was actually going to post that, but you beat me to it. :) > > TJG Mike -- http://mail.python.org/mailman/listinfo/python-list