| Dictionary, Encyclopedia and Thesaurus - The Free Dictionary 3,591,236,292 visitors served. |
Dictionary/ thesaurus | Medical dictionary | Legal dictionary | Financial dictionary | Acronyms | Idioms | Encyclopedia | Wikipedia encyclopedia | ? |
DOS batch file |
Also found in: Wikipedia, Hutchinson | 0.01 sec. |
|
|
DOS batch file A file of DOS commands that are "batch" processed one after the other. Windows also supports batch files (see Windows batch file), which are mostly identical to the DOS commands.To create a DOS batch file, use a text editor such as Edit. If you use a word processor, save your batch file as an ASCII text file, not as a standard document. Always include a .BAT extension with your batch file name. The following batch file switches to the E drive, goes to the PAT directory and runs the MYPROG program:
e:
cd \pat
myprog
If the file above was named PAT.BAT in the BATCH directory on drive C, you would execute it by typing:
C:\BATCH>pat
C:\BATCH>pat
D:\XYZ>pat
E:\BUDGETS>pat
If you create a batch file that works with files in only one directory, then place the batch file in that directory. When you want to run it, go to that directory.
cls Clear the screen
rem Remarks
:: Remarks
echo off Turn off display
@echo off Turn off display (3.3 and up)
echo on Turn on display
echo Display message; for example,
echo Press any key to continue.
call Call other batch file
pause Stop (wait for keystroke)
choice (DOS 6) a way to get user input
if not exist filename goto :line
if not string1==string2 goto :line
if not errorlevel 0 goto :line
for %%varname in (files) do command
%0 - Batch file name
%1 - %9 - Input variables
%varname% - Variable used with Set
Following is an example of the choice batch file command in DOS 6. It loads three different programs depending on receiving A, B or C from the user. If A is entered, errorlevel is 1, B is 2 and C is 3. IF ERRORLEVEL always tests for >=, which is why the largest number is tested first. choice /c:abc Run A. Run B. Run C. if errorlevel 3 goto runC if errorlevel 2 goto runB :runA run program A goto end :runB run program B goto end :runC run program C :end How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content. |
|
| Encyclopedia |
| Free Tools: |
For surfers:
Free toolbar & extensions |
Word of the Day |
Help
For webmasters: Free content | Linking | Lookup box | Double-click lookup | Partner with us |
|---|