Running different programs Below is a simple example of how you can implement the choice options into your batch files. Each line that is in red can be left out of the batch file. They have been included to help explain some of what the batch file means. Windows 2000 and Windows XP users will need to substitute the choice command with the set command; see our set command page for additional help and information with this command. @ECHO OFF REM - LABEL INDICATING THE BEGINNING OF THE DOCUMENT. :BEGIN CLS REM - THE BELOW LINE GIVES THE USER 3 CHOICES (DEFINED AFTER /C:) CHOICE /N /C:123 PICK A NUMBER (1, 2, or 3)%1 REM - THE NEXT THREE LINES ARE DIRECTING USER DEPENDING UPON INPUT IF ERRORLEVEL ==3 GOTO THREE IF ERRORLEVEL ==2 GOTO TWO IF ERRORLEVEL ==1 GOTO ONE GOTO END :THREE ECHO YOU HAVE PRESSED THREE GOTO END :TWO ECHO YOU HAVE PRESSED TWO GOTO END :ONE ECHO YOU HAVE PRESSED ONE :END How to start Windows files and other programs from a batch file To run Microsoft Windows programs or files use the START command. The below example would run Windows Notepad. START /MAX NOTEPAD You can also specify the direct location of the file by typing the below command. START /MAX C:WindowsNOTEPAD.EXE *Windows users who have a different directory (e.g. Windows 2000 users) would need to substitute WINNT or the name of their directory in place of Windows in the above example. The /m representing it to start the window Maximized. See our start command page for additional information about this command. Creating a batch file delay Below is an example of how to delay a batch file any where from 5 to 99 seconds. In the below example we illustrate a 5 second delay. TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL Additionally, you could use the sleep file found on our utility download section. How to make a time log in a batch file The below example demonstrates how to create a time log of when the batch file is loaded, or for example, this could be used in the autoexec.bat when someone logs into a computer that supports this file. ECHO. |TIME > TIME COPY LOG +TIME An alternate, slightly more complicated method that, to our knowledge, cannot be used in Windows NT, Windows 2000 or Windows ME would be the following: echo @prompt set date=$d$_set time=$t$h$h$h > {a}.bat %comspec% /e:2048 /c {a}.bat > {b}.bat for %%v in ({b}.bat del) do call %%v {?}.bat echo %date% %time% >> log Another alternative is: echo. |time |find "current" >> log For the above batch file to work properly you must create a file called "log", by typing: "edit log" (without the quotes) and then save and exit the file that will be 0 bytes. If this file is not created or not created properly you will receive the error message "Content of destination lost before copy". TECHNICAL SUPPORT | | |