How to create a batch file in vba
<p>I'm trying to create a batch file and then write the batch file here is my code:</p>

<pre><code>Dim sr As System.IO.StreamWriter
If fso.FileExists(FolderBrowserDialog1.SelectedPath &amp; "\ServerStart.bat") Then
    fso.DeleteFile(FolderBrowserDialog1.SelectedPath &amp; "\ServerStart.bat")
    sr = My.Computer.FileSystem.OpenTextFileWriter(FolderBrowserDialog1.SelectedPath &amp; "\ServerStart.bat", True)
    sr.Write("java -Xms2048m -Xmx8048m -jar " &amp; fso.GetFileName(file) &amp; " nogui pause")
    sr.Close()
Else
    sr = My.Computer.FileSystem.OpenTextFileWriter(FolderBrowserDialog1.SelectedPath &amp; "\ServerStart.bat", True)
    sr.Write("java -Xms2048m -Xmx8048m -jar " &amp; fso.GetFileName(file) &amp; " nogui pause")
    sr.Close()
End If
</code></pre>

<p>Even though the text looks fine in notepad when I try to run the batch file I get this: '´╗┐java' is not recognized as an internal or external command.
So basically when I use streamwriter to edit the batch file it adds this: '´╗┐</p>