This is my analysis of this boot disk. My personal skill level is limited, so if there is anything inappropriate, please point it out.
************
CONFIG.SYS
************
The 4 menus are specified by CONFIG.SYS. The default is graphical mode GP, with 20 seconds selection time, color code 7. Background color code 0
COMMON section
Loads the XMS driver HIMEM.SYS /testmem
ff (in higher-version HIMEM.SYS, TESTMEM is also OFF by default), without testing memory
//*UMBPCI.SYS I don't know what it is (judging by the filename, I guess it's a driver for loading UMB; I use EMM386.EXE), the moderator's disk has it too*//
Specifies DOS to load into HMA or UMB
Specifies FILES=30, BUFFES=30
STACKS=9,256 I ran into this stack segment setting before; it may make some DOS software unusable.
LASTDRIVE=N, sets the last drive letter to N
The remaining SUBs are all empty
*************
AUTOEXEC.BAT
*************
@ECHO OFF turn off display
set EXPAND=YES //*don't know what this variable is for, the later programs don't seem to use it*//
SET DIRCMD=/O:N //*don't know this environment variable either (moderator please explain)*//
XMSDSK 8192 N: /y specifies 8M XMS as RAMDRIVER, drive letter N
set temp=c:\ set temp folder to C:\
set tmp=c:\ same as above
set ramd=n marker variable for RAM DRIVER, used by later programs to determine the drive letter of RAMD
path=N:\;A:\;C:\ sets search path
cls clear screen
unzip /d /o CAB1.zip n:\ > nul extract CAB1.ZIP to the RAM virtual disk
EXTRACT /Y /e /L n: CAB2.CAB > nul ......CAB2.CAB............
copy command.com n:\ /y > nul copy command.com...........
copy vide-cdd.sys n:\ /y > nul ....vide-cdd.sys..........
set comspec=N:\command.com specify COMMAND.COM path.......
LH CTMOUSE.EXE > NUL mouse driver
LH N:\SMARTDRV.EXE cache
LH N:\DOSKEY.COM > NUL DOSKEY
GOTO %CONFIG% execute according to CONFIG.SYS SUB
OS
tw /np > nul run Chinese character support system
n:
cd \
GOTO END
:CDROM
CALL FINDCD.BAT CALL FINDCD.BAT to load the CD-ROM drive and find the CD drive letter
tw /np > nul run Chinese character support system
N:
cd \
GOTO END
:GP
CALL FINDCD.BAT CALL FINDCD.BAT to load the CD-ROM drive and find the CD drive letter
menua.bat batch file to start the graphical interface
:NOGP
menua.bat batch file to start the graphical interface
:END
***********
FINDCD.BAT
***********
@echo off turn off display
set cdrom= marker variable, used to store the CDROM drive letter
:LOOP
findcd -e find the CDROM drive letter, returns ERROR code
if errorlevel 255 goto NOCD determine the CDROM drive letter according to different returned ERROR codes
if errorlevel 0 set cdrom=A
if errorlevel 1 set cdrom=B
if errorlevel 2 set cdrom=C
if errorlevel 3 set cdrom=D
if errorlevel 4 set cdrom=E
if errorlevel 5 set cdrom=F
if errorlevel 6 set cdrom=G
if errorlevel 7 set cdrom=H
if errorlevel 8 set cdrom=I
if errorlevel 9 set cdrom=J
if errorlevel 10 set cdrom=K
if errorlevel 11 set cdrom=L
if errorlevel 12 set cdrom=M
if errorlevel 13 set cdrom=N
if errorlevel 14 set cdrom=O
if errorlevel 15 set cdrom=P
if errorlevel 16 set cdrom=Q
if errorlevel 17 set cdrom=R
if errorlevel 18 set cdrom=S
if errorlevel 19 set cdrom=T
if errorlevel 20 set cdrom=U
if errorlevel 21 set cdrom=V
if errorlevel 22 set cdrom=W
if errorlevel 23 set cdrom=X
if errorlevel 24 set cdrom=Y
if errorlevel 25 set cdrom=Z
goto END
:NOCD Why not run this SUB first, then run LOOP?
ctload VIDE-CDD.SYS /D:mscd001 load CD-ROM driver (I use OAKCDROM.SYS)
/D:MSCD001 specifies the device name as MSCD001. It can be changed, but it must be the same as MSCDEX.EXE's device name
CTLOAD may be a program that can still load device drivers after system startup, saving the need to load them in CONFIG.SYS,
LH MSCDEX.EXE /D:mscd001 file access format conversion under DOS, so DOS can process ISO9660 file format
GOTO LOOP
:END
******
Summary:
******
How some of the tricks used by this boot disk are implemented
1. > NUL is used to achieve no output (not really a trick to experts) >nul redirects the default display output to the null device NUL
There are other useful tricks too. For example, if a file's HELP is too long, you can redirect its HELP to a file, such as mode/? > mode.txt
(If you're interested, you can look up DOS redirection techniques and pipe | techniques)
2. It uses the ERRORLEVEL function. This is very useful and can improve the program's detection mechanism, running different programs according to different errors or states
3. GET It uses the file GET.EXE to detect keyboard input, such as GET N, and then below checks whether GET is equal to N.
4. Batch files use parameters, for example adding parameters after yiyesong.bat, then checking the parameters inside yiyesong.bat
if "%1"=="/cd" goto cd
if "%1"=="/a" goto a
if "%1"=="/?" goto help
if "%1"=="" goto null
goto end
5. Using LOCATE.COM to detect whether a file exists. For example locate.com %cdrom%:\yiyesong.bat /np /nr
If %cdrom%:\ is changed to %cdrom%: then it becomes a full-disk search. (What he called searching any directory is implemented this way)
Corresponding search methods
98SE locate %cdrom%: w98setup.bin /S:162939! /np /g:y
2000 locate %cdrom%: winnt.exe /s:81757! /c:"set dirname=&d" /np /G:Y
ME locate %cdrom%: w9xsetup.bin /S:181875! /np /g:y
Whether it is the "Yiyesong Software House Boot CD" locate.com %cdrom%:\yiyesong.bat /np /nr (this is an absolute path)
Actually it is just checking whether these 4 files exist, only without specifying an absolute path and doing a full-disk search. If you keep only these 4 files, you can easily
pass its detection mechanism.
For LOCATE.COM usage, just look at /?
6. Automatic installation for 98, ME, 2000: among the tools included on the 98 CD there is a program for making automatic installation scripts.
I forgot the specifics, everyone can look for it themselves. All information that needs to be entered during installation, including the serial number, can be made into a script to achieve a fully
automatic installation.
Specifically on this disk, the corresponding script files are: 98SE Msbatch.inf implementation method SETUP.EXE n:\MSBATCH.INF /IS
2000 Win2kpro.txt SETUP.EXE n:\MEBATCH.INF /IS
ME Mebatch.inf WINNT.EXE /u:n:\win2kpro.txt /s:%dirname%
To disable disk checking during 98 installation, add the /IS parameter. For a specific explanation, see SETUP/?
*******************************
Some unreasonable points and potential BUGs (personal opinion)
*******************************
**************
Program detection mechanism
**************
All batch programs that need to use the CD have 2 detection mechanisms: one checks whether the CD-ROM driver has been loaded, and the other checks
whether it is the "Yiyesong Software House Boot CD"
The detection mechanism is simple.
Example CD-YE.BAT
findcd -e
if not errorlevel 255 goto check
ctload n:\VIDE-CDD.SYS /D:MSCD001
call findcd.bat
This is used to detect whether the CD-ROM has been loaded. If not, it runs the loading batch file FINDCD.BAT. But this part of the program is not very efficient. When the CD-ROM was initially set up,
it used the variable CDROM to store the CD-ROM drive letter. As long as you check whether the value of this CDROM variable is empty, you can determine whether the CD-ROM has been loaded. There is no need to
search for CDROM again and check the error return code. Also, after this section checks whether the CD-ROM has been loaded, if it has not been loaded, it runs one load of VIDE-CDD.SYS,
and then this driver is called again later in FINDCD.BAT. Repeatedly loading the driver is inefficient.
*******************
FINDCD.BAT has a big BUG
*******************
If this machine has no CD-ROM drive at all, but CDROM boot is selected, FINCD.BAT will enter an infinite loop here
:LOOP
findcd -e
if errorlevel 255 goto NOCD
...
GOTO END
:NOCD
ctload VIDE-CDD.SYS /D:mscd001
LH MSCDEX.EXE /D:mscd001
GOTO LOOP
Because there is no CD-ROM drive, FINDCD's error return code is always 255, but if the return code is 255 it loads the CD-ROM driver again, and after loading the driver the return code is still 255...
Even if the BUG above is fixed
this issue may still cause problems later, because many .BAT files use the %CDROM% variable multiple times. If there is no CD-ROM drive, this variable becomes invalid, and all
.BAT files that use this variable may produce unexpected execution results.
There is also a habit issue: FINDCD.BAT and FINDCD.COM have the same filename. In an MSDOS system, FINDCD.COM takes priority over FINDCD.EXE, which takes priority over FINDCD.BAT.
If your system contains both FINDCD.BAT and FINGCD.COM, then to run the .BAT you must type the extension. Although when you use FINDCD.BAT you always
add the extension, if you have a large system and call it many times, one oversight can cause many unexpected results in your program. I suggest not using duplicate names in the future.
******************
CDROM.BAT has a potential BUG
******************
CALL FINDCD.BAT
IF EXIST n:\*.* GOTO END
xmsdsk 4096 N: /y If the computer booted with this disk has no CD-ROM drive, the program will run this line, but AUTOEXEC.BAT initially already specified loading an 8M
RAMDRIVER, and here it loads another 4M again and assigns the same drive letter N. I don't know what result this repeated loading will produce.
:END
%CDROM%:
CD \
****************
Changing the TEMP variable multiple times
****************
Some application batch files change the TEMP environment variable multiple times. Sometimes it is %RAMD%:\, sometimes C:\. If this machine has no partition or for some unexpected reason
drive C cannot be recognized, and this application just happens to need TMP/TEMP temporary storage space, then it will access drive C, but drive C cannot be recognized, so an error will definitely occur. Although this error
is not a major problem, it is still a nuisance for the user.
MENUA.BAT calls GOMENU.BAT, but this file does not exist, so the graphical interface of this boot disk cannot be seen.Open attachment
************
CONFIG.SYS
************
The 4 menus are specified by CONFIG.SYS. The default is graphical mode GP, with 20 seconds selection time, color code 7. Background color code 0
COMMON section
Loads the XMS driver HIMEM.SYS /testmem
ff (in higher-version HIMEM.SYS, TESTMEM is also OFF by default), without testing memory//*UMBPCI.SYS I don't know what it is (judging by the filename, I guess it's a driver for loading UMB; I use EMM386.EXE), the moderator's disk has it too*//
Specifies DOS to load into HMA or UMB
Specifies FILES=30, BUFFES=30
STACKS=9,256 I ran into this stack segment setting before; it may make some DOS software unusable.
LASTDRIVE=N, sets the last drive letter to N
The remaining SUBs are all empty
*************
AUTOEXEC.BAT
*************
@ECHO OFF turn off display
set EXPAND=YES //*don't know what this variable is for, the later programs don't seem to use it*//
SET DIRCMD=/O:N //*don't know this environment variable either (moderator please explain)*//
XMSDSK 8192 N: /y specifies 8M XMS as RAMDRIVER, drive letter N
set temp=c:\ set temp folder to C:\
set tmp=c:\ same as above
set ramd=n marker variable for RAM DRIVER, used by later programs to determine the drive letter of RAMD
path=N:\;A:\;C:\ sets search path
cls clear screen
unzip /d /o CAB1.zip n:\ > nul extract CAB1.ZIP to the RAM virtual disk
EXTRACT /Y /e /L n: CAB2.CAB > nul ......CAB2.CAB............
copy command.com n:\ /y > nul copy command.com...........
copy vide-cdd.sys n:\ /y > nul ....vide-cdd.sys..........
set comspec=N:\command.com specify COMMAND.COM path.......
LH CTMOUSE.EXE > NUL mouse driver
LH N:\SMARTDRV.EXE cache
LH N:\DOSKEY.COM > NUL DOSKEY
GOTO %CONFIG% execute according to CONFIG.SYS SUB
OStw /np > nul run Chinese character support system
n:
cd \
GOTO END
:CDROM
CALL FINDCD.BAT CALL FINDCD.BAT to load the CD-ROM drive and find the CD drive letter
tw /np > nul run Chinese character support system
N:
cd \
GOTO END
:GP
CALL FINDCD.BAT CALL FINDCD.BAT to load the CD-ROM drive and find the CD drive letter
menua.bat batch file to start the graphical interface
:NOGP
menua.bat batch file to start the graphical interface
:END
***********
FINDCD.BAT
***********
@echo off turn off display
set cdrom= marker variable, used to store the CDROM drive letter
:LOOP
findcd -e find the CDROM drive letter, returns ERROR code
if errorlevel 255 goto NOCD determine the CDROM drive letter according to different returned ERROR codes
if errorlevel 0 set cdrom=A
if errorlevel 1 set cdrom=B
if errorlevel 2 set cdrom=C
if errorlevel 3 set cdrom=D
if errorlevel 4 set cdrom=E
if errorlevel 5 set cdrom=F
if errorlevel 6 set cdrom=G
if errorlevel 7 set cdrom=H
if errorlevel 8 set cdrom=I
if errorlevel 9 set cdrom=J
if errorlevel 10 set cdrom=K
if errorlevel 11 set cdrom=L
if errorlevel 12 set cdrom=M
if errorlevel 13 set cdrom=N
if errorlevel 14 set cdrom=O
if errorlevel 15 set cdrom=P
if errorlevel 16 set cdrom=Q
if errorlevel 17 set cdrom=R
if errorlevel 18 set cdrom=S
if errorlevel 19 set cdrom=T
if errorlevel 20 set cdrom=U
if errorlevel 21 set cdrom=V
if errorlevel 22 set cdrom=W
if errorlevel 23 set cdrom=X
if errorlevel 24 set cdrom=Y
if errorlevel 25 set cdrom=Z
goto END
:NOCD Why not run this SUB first, then run LOOP?
ctload VIDE-CDD.SYS /D:mscd001 load CD-ROM driver (I use OAKCDROM.SYS)
/D:MSCD001 specifies the device name as MSCD001. It can be changed, but it must be the same as MSCDEX.EXE's device name
CTLOAD may be a program that can still load device drivers after system startup, saving the need to load them in CONFIG.SYS,
LH MSCDEX.EXE /D:mscd001 file access format conversion under DOS, so DOS can process ISO9660 file format
GOTO LOOP
:END
******
Summary:
******
How some of the tricks used by this boot disk are implemented
1. > NUL is used to achieve no output (not really a trick to experts) >nul redirects the default display output to the null device NUL
There are other useful tricks too. For example, if a file's HELP is too long, you can redirect its HELP to a file, such as mode/? > mode.txt
(If you're interested, you can look up DOS redirection techniques and pipe | techniques)
2. It uses the ERRORLEVEL function. This is very useful and can improve the program's detection mechanism, running different programs according to different errors or states
3. GET It uses the file GET.EXE to detect keyboard input, such as GET N, and then below checks whether GET is equal to N.
4. Batch files use parameters, for example adding parameters after yiyesong.bat, then checking the parameters inside yiyesong.bat
if "%1"=="/cd" goto cd
if "%1"=="/a" goto a
if "%1"=="/?" goto help
if "%1"=="" goto null
goto end
5. Using LOCATE.COM to detect whether a file exists. For example locate.com %cdrom%:\yiyesong.bat /np /nr
If %cdrom%:\ is changed to %cdrom%: then it becomes a full-disk search. (What he called searching any directory is implemented this way)
Corresponding search methods
98SE locate %cdrom%: w98setup.bin /S:162939! /np /g:y
2000 locate %cdrom%: winnt.exe /s:81757! /c:"set dirname=&d" /np /G:Y
ME locate %cdrom%: w9xsetup.bin /S:181875! /np /g:y
Whether it is the "Yiyesong Software House Boot CD" locate.com %cdrom%:\yiyesong.bat /np /nr (this is an absolute path)
Actually it is just checking whether these 4 files exist, only without specifying an absolute path and doing a full-disk search. If you keep only these 4 files, you can easily
pass its detection mechanism.
For LOCATE.COM usage, just look at /?
6. Automatic installation for 98, ME, 2000: among the tools included on the 98 CD there is a program for making automatic installation scripts.
I forgot the specifics, everyone can look for it themselves. All information that needs to be entered during installation, including the serial number, can be made into a script to achieve a fully
automatic installation.
Specifically on this disk, the corresponding script files are: 98SE Msbatch.inf implementation method SETUP.EXE n:\MSBATCH.INF /IS
2000 Win2kpro.txt SETUP.EXE n:\MEBATCH.INF /IS
ME Mebatch.inf WINNT.EXE /u:n:\win2kpro.txt /s:%dirname%
To disable disk checking during 98 installation, add the /IS parameter. For a specific explanation, see SETUP/?
*******************************
Some unreasonable points and potential BUGs (personal opinion)
*******************************
**************
Program detection mechanism
**************
All batch programs that need to use the CD have 2 detection mechanisms: one checks whether the CD-ROM driver has been loaded, and the other checks
whether it is the "Yiyesong Software House Boot CD"
The detection mechanism is simple.
Example CD-YE.BAT
findcd -e
if not errorlevel 255 goto check
ctload n:\VIDE-CDD.SYS /D:MSCD001
call findcd.bat
This is used to detect whether the CD-ROM has been loaded. If not, it runs the loading batch file FINDCD.BAT. But this part of the program is not very efficient. When the CD-ROM was initially set up,
it used the variable CDROM to store the CD-ROM drive letter. As long as you check whether the value of this CDROM variable is empty, you can determine whether the CD-ROM has been loaded. There is no need to
search for CDROM again and check the error return code. Also, after this section checks whether the CD-ROM has been loaded, if it has not been loaded, it runs one load of VIDE-CDD.SYS,
and then this driver is called again later in FINDCD.BAT. Repeatedly loading the driver is inefficient.
*******************
FINDCD.BAT has a big BUG
*******************
If this machine has no CD-ROM drive at all, but CDROM boot is selected, FINCD.BAT will enter an infinite loop here
:LOOP
findcd -e
if errorlevel 255 goto NOCD
...
GOTO END
:NOCD
ctload VIDE-CDD.SYS /D:mscd001
LH MSCDEX.EXE /D:mscd001
GOTO LOOP
Because there is no CD-ROM drive, FINDCD's error return code is always 255, but if the return code is 255 it loads the CD-ROM driver again, and after loading the driver the return code is still 255...
Even if the BUG above is fixed
this issue may still cause problems later, because many .BAT files use the %CDROM% variable multiple times. If there is no CD-ROM drive, this variable becomes invalid, and all
.BAT files that use this variable may produce unexpected execution results.
There is also a habit issue: FINDCD.BAT and FINDCD.COM have the same filename. In an MSDOS system, FINDCD.COM takes priority over FINDCD.EXE, which takes priority over FINDCD.BAT.
If your system contains both FINDCD.BAT and FINGCD.COM, then to run the .BAT you must type the extension. Although when you use FINDCD.BAT you always
add the extension, if you have a large system and call it many times, one oversight can cause many unexpected results in your program. I suggest not using duplicate names in the future.
******************
CDROM.BAT has a potential BUG
******************
CALL FINDCD.BAT
IF EXIST n:\*.* GOTO END
xmsdsk 4096 N: /y If the computer booted with this disk has no CD-ROM drive, the program will run this line, but AUTOEXEC.BAT initially already specified loading an 8M
RAMDRIVER, and here it loads another 4M again and assigns the same drive letter N. I don't know what result this repeated loading will produce.
:END
%CDROM%:
CD \
****************
Changing the TEMP variable multiple times
****************
Some application batch files change the TEMP environment variable multiple times. Sometimes it is %RAMD%:\, sometimes C:\. If this machine has no partition or for some unexpected reason
drive C cannot be recognized, and this application just happens to need TMP/TEMP temporary storage space, then it will access drive C, but drive C cannot be recognized, so an error will definitely occur. Although this error
is not a major problem, it is still a nuisance for the user.
MENUA.BAT calls GOMENU.BAT, but this file does not exist, so the graphical interface of this boot disk cannot be seen.Open attachment
Teamwork !



