Making a FOR (batch file) search creates an infinite loop. How do I stop it?
The following command creates an infinite loop which is not what I want
since I am iterating through files and it needs to end sometime...
Here is what I have:
cd C:\
FOR /R %i IN (*.pst) do @echo %i
See what happens is that when it reaches AppData and finds a .pst (in
AppData\Local\Microsoft\Outlook) there is a shortcut folder inside
AppData\Local called "Application Data" which loops back to AppData\Local
but keeps adding it's name to the address like so:
%AppData%\Local\Application Data\Application Data\Application
Data\Microsoft\Outlook\%filename%.pst
What could I add to my code to keep it from looping or much better to
completely ignore shortcuts so that the loop ends when it finds all the
files that I need?
No comments:
Post a Comment