中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-26 23:33
47,815 topics / 349,928 posts / today 0 new / 48,289 members
DOS启动盘 & LOGO技术 (启动盘室) » About finding the last hard disk partition (or confusion)
Printable Version  841 / 3
Floor1 QEYU Posted 2003-11-29 00:00
中级用户 Posts 42 Credits 229
【Basics】:
set lastdrv=
for %%i in (z y x w v u t s r q p o n m l k j i h g f e d c) do call chkdrv.bat %%i

chkdrv.bat is as follows:
if not %lastdrv%'==' goto _end
if %1'==' goto _end
if %1==%cdrom% goto _end
if %1==%RAMD% goto _end
dready %1 /w
if errorlevel 2 goto _end
set lastdrv=%1
:_end

【Wuyou boot disk configuration】
@ECHO OFF
PROMPT $P$G
set temp=c:\
set tmp=c:\
SET EXPAND=YES
SET DIRCMD=/O:N
set LglDrv=27 * 26 Z 25 Y 24 X 23 W 22 V 21 U 20 T 19 S 18 R 17 Q 16 P 15
set LglDrv=%LglDrv% O 14 N 13 M 12 L 11 K 10 J 9 I 8 H 7 G 6 F 5 E 4 D 3 C
call setramd.bat %LglDrv%
path=%RAMD%:\;%RAMD%:\BAT;%CDROM%:\;%CDROM%:\UCDOS;%CDROM%:\BOOT;A:\;C:\;
copy get.exe %RAMD%:\ > NUL
copy attrib.exe %RAMD%:\ > NUL
copy command.com %RAMD%:\ > NUL
copy edit.com %RAMD%:\ > NUL
copy format.com %RAMD%:\ > NUL
copy fdisk.exe %RAMD%:\ > NUL
copy deltree.exe %RAMD%:\ > NUL
copy restart.com %RAMD%:\ > NUL
copy readme.exe %RAMD%:\ > NUL
copy mouse.* %RAMD%:\ > NUL
copy xxcopy.exe %RAMD%:\ > NUL
rem copy extract.exe %RAMD%:\ > NUL
set comspec=%RAMD%:\command.com
LH MSCDEX.EXE /D:MSCD000 /L:%CDROM%

CDA %CDROM% > NUL
IF errorlevel 1 GOTO NEXTCD
IF NOT EXIST %CDROM%:\BOOT\TW.EXE GOTO NEXTCD
GOTO BOOT

:NEXTCD
CALL CHCDROM.BAT C D E F G H I J K L M N O P Q R S T U V W X Y Z
GOTO BOOT

:BOOT
LH ZENO.EXE /Q > NUL
LH SMARTDRV.EXE > NUL
LH KILLER.EXE > NUL
LH DOSKEY.COM /B=16 > NUL
LH PERUSE.COM /X16 > NUL
LH DOSLFN.COM /Z:CP936UNI.TBL > NUL
LH KEY.COM PY WB > NUL
Set LglDrv=

MD %RAMD%:\TEMP
XXCOPY /E /H %CDROM%:\BOOT\EBD %RAMD%:\ > NUL
%RAMD%:
CD \
LH MOUSE.COM > NUL
LH FINDCD.EXE > NUL
set lastdrv=
for %%i in (z y x w v u t s r q p o n m l k j i h g f e d c) do call chkdrv.bat %%i
MENU.BAT

【Confusion】
Why is %lastdrv% sometimes correct and sometimes wrong? Why can't it be as accurate as %ramd% (or %ramdrv%) and %cdrom%?
Floor2 Wengier Posted 2003-11-29 00:00
系统支持 Posts 10,521 Credits 27,736
This topic was discussed before. It can be easily done with just one or two commands, there's no need to make it this complicated at all.
Floor3 QEYU Posted 2003-11-30 00:00
中级用户 Posts 42 Credits 229
The following is quoted from Wengier's post on 2003-11-29 21:46:33:
This topic was discussed before. It can be easily done with just one or two commands, there's no need to make it this complicated at all.

It does use those two commands, but when put into the Wuyou boot disk, what it finds is the cdrom. During testing, when booting with a floppy disk configuration, what it found was correct. But after burning it, it became wrong.
Floor4 Wengier Posted 2003-11-30 00:00
系统支持 Posts 10,521 Credits 27,736
What I mentioned last time wasn't these commands, was it! For example, I don't know where the following command came from, of course it won't work:

if not %lastdrv%'==' goto _end
if %1'==' goto _end
if %1==%cdrom% goto _end
if %1==%RAMD% goto _end
dready %1 /w

Also, all of the commands below can be replaced with the FINDRAMD from the "Super MS-DOS 7.10 Boot Disk", no need to make it this complicated, and it wastes a lot of boot time:

set LglDrv=27 * 26 Z 25 Y 24 X 23 W 22 V 21 U 20 T 19 S 18 R 17 Q 16 P 15
set LglDrv=%LglDrv% O 14 N 13 M 12 L 11 K 10 J 9 I 8 H 7 G 6 F 5 E 4 D 3 C
call setramd.bat %LglDrv%
...
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023