MS-DOS Batch Programming

 
A batch file or batch program is a plain text file that contains one or more MS-DOS commands and is assigned a .BAT extension. When you type the name of the batch program at the command prompt, the commands are carried out as a sequence.
 
For instance, you can write the following in a batch program:
@echo off
lh mscdex.exe /d:mscd000
smartdrv.exe 4096 2048
if not '%config%==' goto %config%
if '%config%==' goto NOCONFIG
:RAMDRIVE
echo You please find out the drive letter of the MS-RAMDRIVE and 
echo then copy necessary files there to work there.
echo MS-RAMDRIVE is swift. Remember to copy the modified 
echo files back.
goto END
:NORAMDRIVE
echo There is no ramdrive set up. You can work as usual.
goto END
:NOCONFIG
echo There is something wrong with your CONFIG.SYS file or 
echo you bypassed the CONFIG.SYS file, or you are not using 
echo multiple startup.
goto END
:END
To get more knowledge of batch programming techniques, you can refer to the Batch Commands paragraph.
 
Return to MS-DOS Internal Commands