mini-rooter wrote:
for %%a in (a b 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 "%%a:\xyz.bin" set drv=%%a:
(caution, i was testing this out on friday, with 2 flash drives in, both had xyz.bin in the root as i was making copies of the data, my drive which i didnt want to format was E: and the one i was formatting was F:, the computer chose E: and i lost some data... nothing i didn't have backed up but be careful! on a double click this will format what drive its in or what drive it finds with a xyz.bin file)
A pedantic point here, but the code above will save the *last* drive letter that it finds with xyz.bin in the root.
So if you have E: and F: with xyz.bin in the root then it will format F: and not E: as you mention above.