title: Read environment variables from file in Windows Batch (cmd.exe)
body: <p>I'm trying to read variables from a batch file for later use in the batch script, which is a Java launcher. I'd ideally like to have the same format for the settings file on all platforms (Unix, Windows), and also be a valid Java Properties file. That is, it should look like this:</p>
  
  <pre><code>setting1=Value1
  setting2=Value2
  ...
  </code></pre>
  
  <p>Is it possible to read such values like you would in a Unix shell script? The could should look something like this:</p>
  
  <pre><code>READ settingsfile.xy
  java -Dsetting1=%setting1% ...
  </code></pre>
  
  <p>I know that this is probably possible with <code>SET setting1=Value1</code>, but I'd really rather have the same file format for the settings on all platforms.</p>
  
  <p>To clarify: I need to do this in the command line/batch environment as I also need to set parameters that cannot be altered from within the JVM, like -Xmx or -classpath.</p>