title: How to escape characters in a for loop in batch?
body: <p>I am currently working on a Batch file that is writing a customizable .java file.
  With every normal line I can just do the following</p>
  
  <pre><code>echo String[] exampleString = new String[anyNumber]; &gt;&gt; AnyFileName.java
  </code></pre>
  
  <p>Now I encountered a problem - Whenever I want to write a line with a java-for-loop into a file </p>
  
  <pre><code>echo for (int i=0; i&lt;anyNumber; i++) &gt;&gt; AnyFileName.java
  </code></pre>
  
  <p>it just gives me an error as seen here:</p>
  
  <blockquote>
    <p>The system cannot find the specified file.</p>
  </blockquote>
  
  <p>(this is not the actual error message, but I have no English system so I get no english error message, but this is basically what it says).</p></p>
  
  <p>Is there a way to escape the special characters in the <code>echo</code> statement completely, so it gets written into the file and is not trying to get executed as a batch operation? The normal <code>^</code> does not seem to work the way I try it.</p>
  
  <p>EDIT:
  Escaping the brackets instead of the word <code>for</code> worked.</p>