Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7588851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:01:44+00:00 2026-05-30T20:01:44+00:00

Why is batch not running this second for loop? What am i doing wrong?

  • 0

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
    • Tools (CWD)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:01:46+00:00Added an answer on May 30, 2026 at 8:01 pm

    Add a CALL statement in front of "%1\android.bat". If you don’t use CALL, control will not be returned from "%1\android.bat".

    Like this,

    FOR /D %%X in (..\Apps\Mine\*) do if exist "%%X\AndroidManifest.xml" (CALL "%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" (CALL "%1\android.bat" update project -p "%%Y") else (
    echo This is not an android project.
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

But it doesn't work -meaning the java code is not executed. Although the batch
Here's a trivial batch: @echo off if not .%1==.-b goto else echo Running with
The code block below is not running when executed from a batch file. It
Is there a way for a batch file (in this case, running on Windows
When running this script from Powershell or Batch: find and replace characters in Windows
I had a problem with set not working in a batch file; it took
The batch file is something like this, I put the python in some directory
I know I have already answered a similar question ( Running Batch File in
This is a batch file in Windows. Here is my .bat file @echo off
I'm having this argument about using Cursors in TSQL recently... First of all, I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.