This is a places that I store my thoughts, notes, and writes-ups. Although they worked for me, ***USE AT YOUR OWN RISK***!
Friday, May 23, 2014
How to Obtain USB Removable Disk Drive Letter Automatically with a Batch Script
Purpose of this script is to determine the drive letter of a USB thumb drive. Depending on the hardware and drive partitions, every computer you plug a thumb drive into is different. This will give you the drive letter assuming it is the only removable disk.
for /F "tokens=2 delims==" %%i in ('wmic logicaldisk where "drivetype=2" get name /format:value') do (