请看一实例。
下面是autoexec.bat的内容:">>"后的是我现在加的注解
===================
@echo off >>这是关闭回显的命令。@是表示这条命令本身也不显示。
SET DIRCMD=/OGN /4 >>这是设置DIR命令的默认方式
>>/OGN参数表示按组目录的和名称顺序显示
>>/4参数表示年份按4位数字来表示。
set ramd=z >>这是设置一个变量ramd,用来表示虚拟盘
set cdrom=x >>这是设置一个变量cdrom,用来表示光驱
xmsdsk 8192 %ramd%: /y /t >>这是设置虚拟盘的命令 8192是指盘的大小为8M
>> % ramd%:是指定虚拟盘的盘符为ramd,结合上面
>> ramd=z,即指定盘符为Z盘。/Y是确信这个操作
>>/t是指装载到XMS的高位(top)
mkdir %ramd%:\temp >>在虚拟盘上建立一个目录temp
set tmp=%ramd%:\temp >>设置一个变量tmp
set temp=%ramd%:\temp >>设置一个变量temp
copy a:\command.com %ramd%:\ >nul >>复制A盘的command.com文件到虚拟盘,
>> >NUL是指这个命令的屏幕信息输入到NUL这
>> 个特殊的设备上去,这是个空设备。所以就是
>>起到让这个命令不回显的作用。
set comspec=%ramd%:\command.com>>设置一个变量comspec,作用是指定 >>命令解释程序command.com的位置。
mkdir %ramd%:\bin >>在虚拟盘上建立一个目录bin
mkdir %ramd%:\doscmd >>在虚拟盘上建立一个目录doscmd
set ebddir=%ramd%:\doscmd >>设置一个变量edddir,作用是指定ebd文件的目录
set path=%ramd%:\bin >>设置一个变量path,作用是指定路径
copy a:\help.exe %ramd%:\bin >nul >>不回显地复制A盘的help.exe文件
>>到虚拟盘的bin目录里。
lh mscdex /D:MSCD001 /L:%CDROM% >>加载光驱驱动,lh是加载到高位内存里,
>>/D:MSCD001,参数D是设备名称,这个设备名
>>是MSCD001,和你的config.sys里的名称应一致
copy a:\extract.exe %ramd%:\bin >nul >>不回显地复制A盘的extract.exe文件到虚
>>拟盘的bin目录里
echo Extracting device driver(s)... >>显示一条信息 "Extracting device driver(s)..."
>>意思是 正在解压设备驱动(文件)。。。
mkdir %ramd%:\device >>在虚拟盘上建立一个目录device
extract /y /l %ramd%:\device /e a:\scsi.cab >nul>>不回显地解压A盘的scsi.cab这个压
>>缩包到虚拟盘的device目录里。/Y参数表示
>>确认这个操作,/L参数表示将文件解压到
>>指定的目录里。这里是device目录里。
%ramd%:\device\device %ramd%:\device\btdosm.sys >>这里是加载各种驱动的命令
%ramd%:\device\device %ramd%:\device\flashpt.sys
%ramd%:\device\device %ramd%:\device\btcdrom.sys /D:MSCD001
%ramd%:\device\device %ramd%:\device\aspi2dos.sys
%ramd%:\device\device %ramd%:\device\aspi8dos.sys
%ramd%:\device\device %ramd%:\device\aspi4dos.sys
%ramd%:\device\device %ramd%:\device\aspi8u2.sys
%ramd%:\device\device %ramd%:\device\aspicd.sys /D:MSCD001
extract /y /l %ramd%:\bin /e a:\menu.cab >nul >>不回显地解压A盘的menui.cab这
>> 个压缩包到虚拟盘的bin目录里
extract /y /l %ramd%:\doscmd /e a:\ebd.cab >nul >>不回显地解压A盘的ebd.cab这
>>个压缩包到虚拟盘的doscmd目录里
set path=%path%;%ramd%:\doscmd >>设置一个变量path,就是设置路径
>>用;来分隔多个路径,path=%path%的
>>意思是让现在的path变量(路径)的为
>>原来的路径,(;后面是新加进的路径)
>>整个意思是设置新路径为旧路径加上新
>>加入的路径
LH CTMOUSE >NUL >>不回显地装载鼠标驱动到高位内存里
lh smartdrv >NUL >>不回显地装载smartdrv到高位内存里
>>smartdrv是一个磁盘缓存驱动
ECHO. >>echo后面加一个. 表示显示一空行
echo To view Help, type HELP and then press ENTER.>>显示一条信息
>>意思是 想看帮助的话,请键入Help并按回车键
echo. >>echo后面加一个. 表示显示一空行
======================
文件内容完。
不知道这样讲你觉得行不行? :-)
Please look at an example.
The content of autoexec.bat is as follows: The part after ">>" are the annotations I added now.
===================
@echo off >> This is a command to turn off echo. @ means that this command itself will not be displayed.
SET DIRCMD=/OGN /4 >> This is to set the default way of the DIR command
>> The /OGN parameter means to display in the order of group directories and names
>> The /4 parameter means to represent the year with 4-digit numbers.
set ramd=z >> This is to set a variable ramd, which is used to represent the virtual disk
set cdrom=x >> This is to set a variable cdrom, which is used to represent the CD drive
xmsdsk 8192 %ramd%: /y /t >> This is a command to set the virtual disk. 8192 means the size of the disk is 8M
>> % ramd%: is to specify the drive letter of the virtual disk as ramd. Combined with the above
>> ramd=z, that is, specify the drive letter as drive Z. /Y is to confirm this operation
>> /t means to load to the top of XMS
mkdir %ramd%:\temp >> Create a directory temp on the virtual disk
set tmp=%ramd%:\temp >> Set a variable tmp
set temp=%ramd%:\temp >> Set a variable temp
copy a:\command.com %ramd%:\ >nul >> Copy the command.com file from drive A to the virtual disk,
>> >NUL means that the screen information of this command is input to the NUL this
>> special device, this is an empty device. So it is
>> To make this command not echo.
set comspec=%ramd%:\command.com>> Set a variable comspec, the function is to specify >> The location of the command interpreter command.com.
mkdir %ramd%:\bin >> Create a directory bin on the virtual disk
mkdir %ramd%:\doscmd >> Create a directory doscmd on the virtual disk
set ebddir=%ramd%:\doscmd >> Set a variable edddir, the function is to specify the directory of ebd files
set path=%ramd%:\bin >> Set a variable path, the function is to specify the path
copy a:\help.exe %ramd%:\bin >nul >> Copy the help.exe file from drive A to the virtual disk without echoing
>> To the bin directory.
lh mscdex /D:MSCD001 /L:%CDROM% >> Load the CD drive driver, lh is loaded into the high memory,
>> /D:MSCD001, parameter D is the device name, this device name
>> is MSCD001, which should be consistent with the name in your config.sys
copy a:\extract.exe %ramd%:\bin >nul >> Copy the extract.exe file from drive A to the virtual disk without echoing
>> To the bin directory of the virtual disk
echo Extracting device driver(s)... >> Display a message "Extracting device driver(s)..."
>> Meaning is "Extracting device driver(s)..."
mkdir %ramd%:\device >> Create a directory device on the virtual disk
extract /y /l %ramd%:\device /e a:\scsi.cab >nul>> Extract the scsi.cab compressed package from drive A to the virtual disk without echoing
>> The /Y parameter means
>> Confirm this operation, the /L parameter means to extract the file to
>> The specified directory. Here is the device directory.
%ramd%:\device\device %ramd%:\device\btdosm.sys >> This is a command to load various drivers
%ramd%:\device\device %ramd%:\device\flashpt.sys
%ramd%:\device\device %ramd%:\device\btcdrom.sys /D:MSCD001
%ramd%:\device\device %ramd%:\device\aspi2dos.sys
%ramd%:\device\device %ramd%:\device\aspi8dos.sys
%ramd%:\device\device %ramd%:\device\aspi4dos.sys
%ramd%:\device\device %ramd%:\device\aspi8u2.sys
%ramd%:\device\device %ramd%:\device\aspicd.sys /D:MSCD001
extract /y /l %ramd%:\bin /e a:\menu.cab >nul >> Extract the menui.cab compressed package from drive A to the virtual disk without echoing
>>
extract /y /l %ramd%:\doscmd /e a:\ebd.cab >nul >> Extract the ebd.cab compressed package from drive A to the virtual disk without echoing
>>
set path=%path%;%ramd%:\doscmd >> Set a variable path, that is, set the path
>> Separate multiple paths with ;, the meaning of path=%path% is
>> To make the current path variable (path) be
>> The original path, (; followed by the newly added path)
>> The whole meaning is to set the new path as the old path plus the new
>> Added path
LH CTMOUSE >NUL >> Load the mouse driver into the high memory without echoing
lh smartdrv >NUL >> Load smartdrv into the high memory without echoing
>> smartdrv is a disk cache driver
ECHO. >> echo followed by a. means to display an empty line
echo To view Help, type HELP and then press ENTER.>> Display a message
>> Meaning is "If you want to view help, please type Help and press Enter"
echo. >> echo followed by a. means to display an empty line
======================
The file content is complete.
I don't know if this explanation is okay for you? :-)