Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>else</code> has to be on the same line where you close the last block, i.e. the <code>)</code>:</p> <pre><code>if !var_machine64! == 1 ( If exist "C:\Program Files (x86)\Microsoft" ( echo Microsoft folder not available goto End ) ) else ( If exist "C:\Program Files\Microsoft" ( echo Microsoft folder not available goto End ) ) </code></pre> <p>I took the liberty of fixing indenting and a superfluous space in a folder name as well.</p> <p>This fixes your immediate problem of the syntax error but won't help since the batch file won't work anyway. You cannot use any whitespace around the <code>=</code> in <code>set</code> statements because otherwise you're creating a variable that ends in a space with a value that begins with one. So:</p> <pre><code>set var_machine64=0 if exist "C:\Program Files (x86)" ( set var_machine64=1 ) </code></pre> <p>will make things work nicer. Also note that to use delayed expansion you need either <code>setlocal enabledelayedexpansion</code> before that in your batch file or start <code>cmd</code> with <code>/v:on</code>. I just guess you're not showing the whole file (which is ok, but given the error rate in this short snippet I'd say you should double-check everything else).</p> <p>Random side note: It's not nice to include <code>exit</code> in a batch file because, when run from an interactive session it will kill it. If you just want to exit the batch file (and not the whole command processor with it) use <code>exit /b</code> or <code>goto :eof</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload