Why is batch not running this second for loop? What am i doing wrong? The first loop runs fine, but the second loop is never hit. I even put an echo statement after the first loop and it is not even displayed.
FOR /D %%X in (..\Apps\Mine\*) do if exist "%%X\AndroidManifest.xml" ("%1\android.bat" update project -p "%%X") else (
echo This is not an android project.
)
FOR /D %%Y in (..\Apps\Theirs\*) do if exist "%%Y\AndroidManifest.xml" ("%1\android.bat" update project -p "%%Y") else (
echo This is not an android project.
)
More details
The current working directory also has no () or spaces in the name.
Windows7 64bit.
This is the exact argument i am using:
> update_project.bat C:\Users\MyUserName\android-sdks\tools
That is all the contents of the batch script. There is nothing else in it.
Here is the directory structure. The batch script is run from the CWD.
- Projects
- Apps
- Mine
- App1
- App2
- Theirs
- App3
- App4
- Mine
- Tools (CWD)
- Apps
Add a
CALLstatement in front of"%1\android.bat". If you don’t useCALL, control will not be returned from"%1\android.bat".Like this,