Skip to content Skip to sidebar Skip to footer

Automating Things with Batch Files: They Work on Today's Computers Too!



If you're familiar with MS-DOS, you'll recall that it's a command-driven operating system that executes functions issued at the C:> prompt. The only way to make an MS-DOS computer perform a task was to type a command at this prompt, which was a rather cumbersome way to use a computer.


For example, to load Microsoft's simple editing program, you had to type the name of the drive, the directory, and then the program's name. So, if Microsoft Edit was in a folder named "Process," you could start the program by typing "C:>process\edit.com." Only then would the program load up for use.


This is a small command, but imagine if you had a program that was deeply nested within a series of folders. You could end up typing a command as wide as your computer screen or worse, long enough that the entire command would have to wrap onto the next line! Imagine having to type these long commands every time you wanted to start a program. Yikes!


That's one of the reasons why batch files became so popular. Batch files are small text-based documents that contain a bunch of these commands on their lines. When executed, they would process each command without the user having to type each one.


When Windows was developed, the need for typing commands was essentially eradicated thanks to the introduction of the point-and-click interface. But this didn't stop the batch file fever that started under MS-DOS - and in some small circles, batch files are still as popular as they were in the beginning.


Even though you may use Windows XP or Vista, batch files can save you tons of time by automatically starting multiple programs and performing different tasks at the click of a button. They don't require any extensive programming background, and you don't need to encrypt them with some weird, expensive compiler. Batch files are plain text files, and you can build one for your own personal use with Windows Notepad.


For example, you could make a batch file that loads up your favorite websites at once, or you could make a batch file that fills your desktop with the most important applications for the day. To do so, you only need a little knowledge about the locations of these applications.


Let's say that every day, you need to load up the Yahoo web browser, Microsoft Word, and the calculator that comes with Windows. Instead of doing this by hand, you could write a batch file to do it for you.


First, you'd load up Notepad and type in the following:


START "http://www.yahoo.com"

START "c:/program files/Microsoft office/office/winword.exe"

START "c:/windows/calc.exe"


You would then save this data into a file named "mytasks.bat" on the Desktop for easy access. Each time you double-clicked on this file, the Yahoo website would load up, Microsoft Word would start, and the simple calculator would pop up.


Since you want these programs to load every day, you could create a shortcut to this file and place the shortcut inside your computer's Start Up folder. That way, these three programs would load every time you turn on the computer. If you wanted these programs to start minimized, you could type the following into a batch file instead:


START http://www.yahoo.com /m

START "c:/program files/Microsoft office/office/winword.exe" /m

START "c:/windows/calc.exe" /m


This will run all three programs as before, but the "/m" parameter will minimize them so that they don't clutter up the desktop.


Other people have found much more creative and effective ways to use batch files, but the important thing is that you know they're a resource you can use to save a few seconds or minutes in performing important tasks. We've come a long way from MS-DOS, but it's still a valuable source of automation that anyone can use with no programming knowledge at all.


Post a Comment for " Automating Things with Batch Files: They Work on Today's Computers Too!"