I'm trying to figure out how to find the drive letter of my usb so that I can use it in a batch file. I don't want to change the drive letter, I just want it to detect the drive letter as it can change when I use it in another computer. How can I do this?
The code is just a test for myself as I am learning DOS, all it does is dir<every letter of the alphabet> and output each one in a separate file on my usb which is drive Z:. On the other computer I use, the drive is registered with the letter D:, so
I just want to e able to run the batch file and let that deal with finding the usb drive letter without the need for manual editing.
↧