Running Statements Multiple Times

Microsoft® Windows® 2000 Scripting Guide

One reason system administration is so difficult and so time-consuming is that computing environments are dynamic. This means that system administrators find themselves doing the same tasks over and over. For example, the fact that a computer has adequate hard disk space today is no guarantee that it will have adequate hard disk space a month from now, a week from now, or even an hour from now. Because there is no guarantee, you must check hard disk space repeatedly. Likewise, when monitoring processor use, you might want to check this value every 10 seconds for the next 5 minutes. Trying to perform this task manually would be very difficult, extremely tedious, and prone to error.

Of course, scripts get neither tired nor bored, nor are scripts apt to start making errors the more often they have to repeat a task. This makes a script the perfect vehicle for carrying out the same activity over and over. With VBScript, repetitive tasks can be performed by means of a Do loop within your code.