China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-23 21:01
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » About finding the last hard disk partition (or confusion) View 717 Replies 3
Original Poster Posted 2003-11-29 00:00 ·  中国 黑龙江 哈尔滨 联通
中级用户
新DOS时代绿色菜狼
Credits 229
Posts 42
Joined 2003-07-03 00:00
23-year member
UID 6341
Gender Male
Status Offline
【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%?
Floor 2 Posted 2003-11-29 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
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.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 3 Posted 2003-11-30 00:00 ·  中国 黑龙江 哈尔滨 联通
中级用户
新DOS时代绿色菜狼
Credits 229
Posts 42
Joined 2003-07-03 00:00
23-year member
UID 6341
Gender Male
Status Offline
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.
Floor 4 Posted 2003-11-30 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
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%
...
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Forum Jump: