Reference a Volume/Drive by Label
问题 I'm trying to write a batch file to xcopy a folder to a removable USB drive. The problem that I face, however, is that drive letters are subject to change, so I would like to be able to do this by referencing the volume label instead of the drive letter. Any ideas? An hour of Google-ing has proved fruitless. :( 回答1: This command should discover the drive with the correct label and store the drive letter (with colon) in variable "usb" for /f %%D in ('wmic volume get DriveLetter^, Label ^| find