Automating Tasks With Batch Files - Ideas That Work on Today's Personal Computers Too!

Jun 29
11:28

2010

Robert Hosken

Robert Hosken

  • Share this article on Facebook
  • Share this article on Twitter
  • Share this article on Linkedin

If you're familiar with MS-DOS at all, you'll remember that it's a command-line-driven OS that performs functions issued at the C:> prompt. The only way to make an early MS-DOS computer to perform something was to type a command at this prompt; and if you might imagine, it was a rather clumsy method to use a PC. But that's how large mainframe computers worked, and it was simply carried over to early PCs.

mediaimage
If you're familiar with PC-DOS at all,Automating Tasks With Batch Files - Ideas That Work on Today's Personal Computers Too! Articles you'll remember that it's a command-line-driven operating system that performs functions you issue at the C:> prompt. The only means to get an early PC-DOS PC to perform anything was to type a command at the C:> prompt; and if you can imagine, it was quite a clumsy way to use a personal computer. But that was how large mainframe computers operated, and it was simply carried over to early personal computers.

For example, start up Microsoft's basic editor program, you had to type the drive letter where the program was located, the directory (they called a folder a "directory" back then) that the program was in, and then the program name. So if Microsoft Edit was located in a folder named "Programs" you could start the program by typing "C:>programs/edit.com". Only then would the program start up for use.

This example is a small command, but simply imagine if you had a program that was deeply nested inside a series of directories. You could be entering a command the width of your computer's screen, or even worse, long enough that the entire command would begin to wrap around on the next line! So imagine that you had to type these long commands every time that you would start a program. How awful!

That's only one of the reasons that batch files were so well-liked. Batch programs are small text documents with a *.bat extension which contain a string of such instructions, each on its own line. When executed, they would perform each instruction without the user having to enter every one of them. See our offsite backups link below to find out how you can use batch files with the "PersonalBackup" program to keep a month's worth of versions of your weekly (full) and daily (partial) backups.

When Windows was developed, the need for entering commands was essentially eliminated, thanks to using the point-and-click (mouse) interface. But this didn't quell the batch program fever that began under MS-DOS - and in a few small groups, batch files are still as well-liked today as they were 25 years ago.

Even though you may be using Windows XP, Vista or Windows 7, batch files can save you tons of effort by automating the launch of several programs and performing various functions by one click of a button. They don't need any heavy-duty background in programming and they don't need to be encrypted with a complicated, expensive compiler. Batch files are plain text files, and you could build one for your personal use in Windows Notepad.

You could build a batch file which starts up your most-used websites at once, for example, or you can write a batch program that loads your desktop with your most necessary programs for each day. To do so only requires a bit of knowledge about the locations of these applications.

Let's say that each day we need to load up the Yahoo web browser, then run Microsoft Word, and then start up the calculator that is included with Windows. Instead of doing this by hand, we can build a batch file to do it for us.

First, we would start up Notepad and type in these lines:

START "http://www.yahoo.com"
START "c:/program files/microsoft office/office/winword.exe"
START "c:/windows/calc.exe"

We would next save these lines into a file named "mytasks.bat" onto our Desktop for ease of access. Every time we double-clicked on this file, the Yahoo website would start up, Microsoft Word would run, and the simple calculator would pop up.

Since we would like these programs to load each day, we could create a shortcut to this batch file and then place the shortcut to our PC's Startup folder. That way, these three programs would start each time we switch on the computer. If you wanted these programs to load minimized, you can enter the following into a batch program instead:

START "http://www.yahoo.com" /m
START "c:/program files/microsoft office/office/winword.exe" /m
START "c:/windows/calc.exe" /m

This would start all three programs as previously, but the "/m" characters would minimize them so that they wouldn't clutter up the Desktop.

Various people have discovered much more creative and effective ways to utilize batch files, but the essential point is that you know that they're a resource you can use to save a few seconds or minutes in performing important jobs. Also, see our offsite backups link on how to automate your backups with the free "PersonalBackup" program.

We've progressed a long way from MS-DOS, but batch programs are still a valuable resource for automation that anyone can use with no heavy-duty programming knowledge whatsoever.

Yours truly,

Bob Hosken
"Dr. Bob the CompuNerd"


Also From This Author

How to Stay Healthy As You Grow Older: Take Vitamins and Supplements

How to Stay Healthy As You Grow Older: Take Vitamins and Supplements

The aging process in the body is part of living each day of our journey through life. Halting our march toward eternity isn't possible, thus we need to care about our bodies daily. It's well-known that as time marches on we require a regimen offood supplements and vitamin pills to substitute for the reduction of bodily chemicals and substances.
Setting Up Your Personal Computer with Your Choices: Having Your Computer Work the Way You Want

Setting Up Your Personal Computer with Your Choices: Having Your Computer Work the Way You Want

Even though you did not plan or construct your PC, you may transform it into a machine that responds to your way of using it just like you were the original engineer or developer. That's because the PC is merely a workbench - a blank canvas, if you will - allowing you to guide its workings or design the perfect system. All this is possible from making just a few tweaks in your computer's current configuration. You can receive help doing this through online PC support.
A Few Ordinary Computer Errors, What They Mean, and How to Locate Online PC Support

A Few Ordinary Computer Errors, What They Mean, and How to Locate Online PC Support

Personal computer errors may crop up when least expected, they may cause the entire computer to suddenly shut down, or they may unfortunately mess up your information to the point where it can't be understood - one reason you should have offsite backups. Even though they can't always be bypassed, it's important to be aware that personal computer glitches can usually be corrected. The key is to learn what personal computer errors are, learn what they mean when they pop up, and know how to minimize their popping up to begin with. Help can be found through online PC support.