Here is the problem. We have 100 external USB drives for 500 GB. Each drive will go to a new location throughout the year. What is the best way to automatically detect that a USB drive is connected to a Windows system and then assign the drive letter Z: \? These USB drives will be connected to many 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)
difficult to use due to the dynamic nature of the mobile USB drive in different Windows systems all the time? Can you automatically detect through WMI or do some kind of mounting volumes using NTFS?
source
share