Here is the problem. We have 100s of external 500gb USB drives. Each drive will travel to a new location through the year. What is the best way to automatically detect that a USB drive has been plugged into a Windows system, then assign a Z:\ drive letter? These USB drives will be plugged into lots of different computers so a script like this
import subprocess
diskpart_data = "z-drive.txt"
open (diskpart_data, "w").write ("""
select volume F:
assign letter=Z
""")
subprocess.call ('diskpart /s %s' % diskpart_data)
is hard to use due to the dynamic nature of the mobile USB drive on different Windows systems all the time? Could you autodetect through WMI or do some kind of volume mount with NTFS?