Here's what I have so far:

import os.path as op
for d in map(chr, range(98, 123)): #drives b-z
    if not op.isdir(d + ':/'): continue

The problem is that it pops up a "No Disk" error box in Windows:

maya.exe - No Disk: There is no disk in the drive. Please insert a disk into drive \Device\Harddisk1\DR1 [Cancel, Try Again, Continue]

I can't catch the exception because it doesn't actually throw a Python error.

Apparently, this only happens on removable drives where there is a letter assigned, but no drive inserted.

Is there a way to get around this issue without specifically telling the script which drives to skip?

In my scenario, I'm at the school labs where the drive letters change depending on which lab computer I'm at. Also, I have zero security privileges to access disk management.

Edit
Report