I’m trying to make a script that will search all of the devices that are plugged into the computer and find the file common then echo back if the device was or was not found.
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:\common\" echo Device was found on %%d:
)else(
echo Device was not found
)
pause
this code doesnt seem to work though is any able to help?
There are a couple of syntactic issues in your code:
else).else(as @dystroy already mentioned)else.Hint: proper formatting and indenting would have hinted at some of the issues.
Your code should look something like this: