Alias for windows command line

When working with git and node js you end up using the command line quite a lot. As a Windows grown developer this is kind of a strange sensation really, you quickly start to appreciate why those Linux guys constantly advocated the bash and you also understand why they didn’t move over to windows. The windows command line leaves a lot to wish for and if you try to do the simplest things you’ll have to fight long and hard to get there.

Anyway, I wanted to open some files for editing from the command line and I want to open them using Sublime. I could add the Sublime directory to my path variable and open it using sublime_text, this feels quite naff to be honest and I came across some posts saying ”just alias it”. What’s that I wonder, hmm.. okay only available for OS X/Linux, darn.

I’ll just have to create an alias for Windows then. This here batch file will do exactly that, put it in any folder in your path variable (I’ve got a common one set up for all my command line tools), then write this:

That’ll create you an alias command batch file that will trigger Sublime with any arguments you give it:

The file isn’t complicated at all, it just contains:

True, I could’ve just written this once and been done with it 🙂 but I thought, why not give us in the Windows world a bit of that bash yummyness. Here’s the full content of the alias.cmd batch file for any one interested:

Now to continue with what I was actually supposed to do… 🙂