巧用批处理文件

Author: 河南 段宗君 Date: 1993-04-23

        我在使用以上系统时,编制出如下自动批处理文件放在C盘根目录下。C>TYPE AUTOEXEC.BAT
        @echo  off
        PATH=C:\CCED;C:\;C:\dos;C:\ZRM
        prompt  $p$g
        ECHO***************
        ECHO*                          *
        ECHO*A___进入GWBASIC系统*
        ECHO*                          *
        ECHO*B___进入WPS2.1系统*
        ECHO*                          *
        ECHO*C___进入CCED40系统*
        ECHO*                          *
        ECHO*D___进入汉字FOXBASE2.0系统*
        ECHO*                          *
        ECHO***************
        ECHO请根据上面菜单选择(A_D)
        date  01-01-1991
        CD\WPS
        SPLIB
        SPDOS/VGA
        CD\ZRM
        ZR  3
        ZC  L1
        VN  L8
        cd\
        menu
        echo  on
        使得开机系统自检后,自动进入SPDOS状态且将自然码5.0汉字输入系统悬挂其上接着屏幕显示菜单。MENUBAT文件内容如下:
        C>TYPE MENU.BAT
        CLS
        @  ECHO  OFF
        上述菜单中有四个选择项(A_D),其选择代号都对应有相应的批处理文件,这些文件均与AUTOEXEC.BAT放在C盘根目录中,其内容如下:
        C〉TYPE  A.BAT
        @  echo  off
        CD\DOS
        GWBASIC
        CD\
        MENU
        C〉TYPE  B.BAT
        @  ECHO  OFF
        CD\
        CD\WPS
        WPS
        cd\
        menu
        C〉TYPE  C.BAT
        @  ECHO  OFF
        CD\
        CD\cced
        cced
        cd\
        menu
        C〉TYPE  D.BAT
        @  echo  off
        CD\
        d:
        cd\fox
        fox
        cd\
        c:
        menu
        总之,巧用DOS下的批处理文件,可以运用“菜单”技术实现友好的人机界面,达到系统间转换自动化。