中国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 18:45
47,815 topics / 349,928 posts / today 0 new / 48,288 members
DOS启动盘 & LOGO技术 (启动盘室) » Automatically get the drive letter of the last FAT partition on the hard disk!
Printable Version  1,025 / 5
Floor1 绿叶林 Posted 2003-10-03 00:00
初级用户 Posts 4 Credits 112
When assembling a machine, most people are used to making the last partition on the hard disk a backup partition, where they keep the Win98 installation files as well as the ghost backup of the system partition (usually the first partition), etc.

If a boot disk is given the function of automatically getting the drive letter of the last FAT partition on the hard disk, then automatic system backup and restore can be achieved.


How can I automatically get the drive letter of the last FAT partition on the hard disk?


Please help!


Floor2 MLD Posted 2003-10-03 00:00
高级用户 Posts 173 Credits 570
There are many ways to achieve automatic system backup and restore; it doesn't have to depend on getting the drive letter of the last FAT partition on the hard disk.
Floor3 绿叶林 Posted 2003-10-04 00:00
初级用户 Posts 4 Credits 112
Actually, this is just one of my personal habits (and I believe it's also the habit of most people).
For example:
When installing Windows 98, it can automatically get the drive letter of the last FAT partition on the hard disk, copy the Win98 source files from the CD to that partition, and finally install Windows98 automatically from the hard disk. That way, when adjusting some Win98 settings, it won't keep prompting “insert the Win98 source CD,” and reinstalling Win98 is also convenient.
Floor4 电吉入侵 Posted 2003-10-06 00:00
初级用户 Posts 377 Credits 1,480
Because MS-DOS7.1 can only recognize FAT format, you just need to look for the last drive letter..
I've answered a question like this before.. try searching for it
Floor5 QEYU Posted 2003-10-06 00:00
中级用户 Posts 42 Credits 229
I tried several times. If %cdrom% is loaded first, it didn't work (the lastdrv found was cdrom), so I had no choice but not to load it when entering the auto backup/restore option, and then load it again before entering the DOS command line option.

The following is for reference only:

Set the last drive letter as: %lastdrv%:\
Add dready.com

【AUTOEXEC.BAT】
set lastdrv=
for %%i in (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
if errorlevel 100 goto begin

【CHKDRV.BAT】
@echo off
if not %lastdrv%'==' goto _end
if %1'==' goto _end
if %1==%cdrom% goto _end
if %1==%RAMDRIVE% goto _end
dready.com %1 /w
if errorlevel 2 goto _end
set lastdrv=%1
:_end
Floor6 mafa3 Posted 2003-10-06 00:00
初级用户 Posts 7 Credits 150
Two methods, please refer to them.
Open attachment

%cdr%=the drive letter of the last FAT partition on the hard disk
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023