How do, DOS
Much like recent activity on this blog, my involvement with the windows command has been characterised by being entered into begrudgingly, generally taking a lot longer than I intend, and leaving me thinking that there’s something better I could be doing with my time.
You see, I’m not really that much of a geek – I own very few gadgets (quite possibly none, unless a mandolin counts) and find playing around with computers tedious (one reason I’m drawn to front-end development is it’s far removed from the confusing and arcane inner-workings of the computer). My family didn’t own a computer back in the 80s, when typing in commands at the prompt was the norm, so the whole experience is alien to me.
But, as of today, I’ve lost my fear… thanks to the humble batch file.
For anyone who doesn’t know what a batch file is, it’s a file which runs a series of command line statements. It has a .BAT file extension, and basic ones are very easy to write – the syntax is exactly the same as typing into the DOS command line itself… except you’re typing in a nice text editor so trivial things such as using ctrl+v to paste, using the cursor keys to move anywhere, and clicking and dragging to select text work. And, best of all, you only need type your commands once, into the batch file, and then just click on it (or a shortcut) next time you want to run it.
So, for example, every time I wanted to minify CSS and JS on one of my localhost sites before an upload to the live server I used to spend 5-10 minutes typing, making mistakes, swearing and crying. Now I just click an icon, and don’t feel the need to swear or cry half as much.
- Basic batch file tutorial (ignore the bit about autoexec – in modern windows you can run a batch file by just double clicking an icon)
- More comprehensive guide to commands and syntax
No related posts.