All Speed Tips
Ask The PC Expert
Subscribe via Email
Subscribe via RSS
Learn To Repair PCs With The Right Course
Buying a Refurbished PC
How to Optimize Droid Razr Battery
A batch file is a file in the operating system that holds the instructions that the operating system has to perform. They are executable text files and are run by the system in a line-by-line procedure. They are an important part in the programming unit of the computer and are mainly located in the core blocks of computing as they contain executable statements that are regularly used by the operating system. They are more common in UNIX based system, where they are known as shell or shell scripts, than in windows based systems. Batch files are generally used by the system administrators to initialize repetitive processes. These files have the extensions such as - .bat, .cmd, or .btm. There is a subtle difference between the file extensions. The first one (.bat) is used by Microsoft for batch files and can be used by most of the OS, the second(.cmd) is to be executed in the command prompt and the third(.btm) by 4DOS and is much faster as it is loaded at once rather than the line by line loading.
Batch Files can be used to do plenty of things. Batch wait is an example of one such case. The implementation of the WAIT command in the batch file makes it to pause or wait for a specific number of seconds before proceeding further. This is of great use as it provides support to batch files which display some text providing the users time to read and also providing it time to connect with other resources.
One can apply the wait command in the batch file when there is a time period that is required to be attached to the batch file. It makes the batch file sleep for a few seconds before the work actually starts. The wait command does not work for UNIX, but works for Windows and DOS. There are different ways to implement the wait command. Since the operating systems do not come inherent with it, one has to create a file to implement it. The methodology is simple. First, a batch file has to be created with the following code:
Windows XP and greater
@ping 127.0.0.1 –n 2 –w 1000 > nul
@ping 127.0.0.1 –n %1% -w 1000> nul
This particular coding should not be used for real time processing as it is known to cause the batch file to run over for a few milliseconds. There is another provision in Windows XP and Windows 2003 as an alternative to using PING, there is a batch file SLEEP that can be successfully incorporated. For the SLEEP command, you will need the Windows 2003 Resource Kit.
Windows 95 and Windows 98
Create a batch file with:
@choice /T: N, %1% >NUL.
Then there is a choice to make the file wait. Now, depending on the amount of time that you would want the file to wait, you can add the code. If you want a time lag of say 20 seconds, the code will be as follows:
ALL WAIT 20
The above code works completely fine for windows 95 and windows 98.
If you enjoyed this post, please or
Web site and all contents © Copyright ComputerTooSlow.com 2012, All rights reserved.