You rather than giving yourself a hernia jumping through microsoft hoops, why dont you just use a decent script language instead of BAT. You can even do it with calibre itself for example:
Create a .py file called myscript.py
Code:
import subprocess, sys
# Command line arguments ar in sys.argv
print 'Command line arguments', sys.argv
subprocess.check_call(['ebook-convert', sys.argv[1], sys.argv[2]])
subprocess.check_call(['ebook-viewer', sys.argv[2]])
Now run this script with
Code:
calibre-debug -e myscript.py input_file.epub output_file.epub
This will run ebook-convert for you and open the result in the viewer.
I'm sure you can figure out the rest.