MS-DOS 批处理编程

  批处理文件或者批处理程序是一个包含一个或多个 MS-DOS 命令并以 .BAT 为扩展名的纯文本文件。当你在命令提示符输入批处理文件的名字的时候,里面的命令就会按顺序执行。
  比如说,你可以在一个批处理文件中写入下列内容:
@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
  更多有关批处理编程的技巧,你可以参考批处理命令章节。

返回 MS-DOS 内部命令