windows batch file tips


using batch parameter

[sourcecode language="bash"]
@echo off
sublime_text.exe %1
[/sourcecode]

hide output and output only the stuff you want to reveal

from http://stackoverflow.com/questions/2044882/how-to-hide-batch-output

[sourcecode language="bash"]
@echo off
echo verbose stuff 1
echo verbose stuff 2
echo verbose stuff 3
echo important stuff! >&2
echo verbose stuff 4
[/sourcecode]

launch an exe file asynchronously

By default, scripts run synchronously. What it means is that when you launch an exe file, the batch file doesn't go on running until you close the program, and it is quite annoying.

So, use "start" command to run steps asynchrounously.

[sourcecode language="bash"]
start sublime_text.exe %1
[/sourcecode]