I have the following code in a batch file to help me find a USB drive. This batch file looks for a directory that I placed a folder on the USB drive to help with the search. Generally the USB letter is unknown so rather than just fumbling around and entering letters until I stumble upon the right one I have found this bit of code to put in the batch.
I am wondering if there is a way to use the result "%%d" in a variable to finish off the batch by going to the found drive. I tried just using %%d: to try and change to the Found Drive but that doesn't work.
Note that this works really well in the PE but throws a fit in Windows 7. ( you get about 4 "No Disk" Errors which is not really a problem because I know it works in the PE environment)
Thank you for any advice and help you can send my way.
for %%d in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
if exist %%d:\B75_hp\ (
ECHO USB Drive Has Been Found at : %%d