I would expect an SDCard reader is one of the specified drives.
When I tried the script on a card reader (with no card inserted) it threw an error: "Exception Processing Message ..." "Cancel/TryAgain/Continue" (It was however fine for my empty CD-R drive, it may also matter whether the optical drive has write capabilities, since windows lets you cache writes and insert a disk later).
This behavior is probably specific to the device you are checking at each drive letter.
And again..on MY Win7 machine it matters not what the drive is or it's state
(or whether media is inserted or not)
But on my father-in-laws machine I get the aforementioned system error message every time, no matter what.
I thought their might be some kind of window setting that I could turn off to prevent that message from happening.
Oh well..thank you all regardless!
The issue likely is not windows, but rather the device. It's likely that if you have an SD card reader it responds differently do being poked when it has no media inserted than your father-in-law's. If you don't have an SD card reader, then it maybe that all SD card readers behave that way (mine does).
You can test it by using your card reader on his machine and/or his card reader on your machine.