windows batch file tips

using batch parameter

@echo off
sublime_text.exe %1

hide output and output only the stuff you want to reveal


@echo off
echo verbose stuff 1
echo verbose stuff 2
echo verbose stuff 3
echo important stuff! >&2
echo verbose stuff 4

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.

start sublime_text.exe %1

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s