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-08-12 21:27
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Automatically switch to the CD-ROM drive letter after boot finishes? View 756 Replies 4
Original Poster Posted 2003-07-24 00:00 ·  中国 广东 深圳 联通
初级用户
Credits 187
Posts 19
Joined 2003-06-19 00:00
23-year member
UID 5536
Gender Male
Status Offline
How can I automatically switch to the drive letter where the CD-ROM drive is after autoexec.bat finishes, instead of A:>?
Floor 2 Posted 2003-07-26 00:00 ·  中国 湖北 武汉 电信
元老会员
★★★★★
步行的人
Credits 9,654
Posts 3,351
Joined 2003-03-11 00:00
23-year member
UID 1113
Gender Male
From 湖北
Status Offline
Just set the CD-ROM drive letter in the batch file, then use the relevant statement to switch to it.
弄花香满衣,掬水月在手。
明月鹭鸟飞, 芦花白马走。
我自一过后,野渡现横舟。
青云碧空在,净瓶水不流。
http://dos.e-stone.cn/guestbook/index.asp
======中國DOS聯盟=====
我的新网页http://rsds.7i24.com欢迎光顾
Floor 3 Posted 2003-07-26 00:00 ·  中国 广东 深圳 联通
初级用户
Credits 187
Posts 19
Joined 2003-06-19 00:00
23-year member
UID 5536
Gender Male
Status Offline
I tried using this in the batch file:
%CDROM%:
but it didn't work. How can I switch to it?
Floor 4 Posted 2003-07-26 00:00 ·  中国 江苏 无锡 电信
高级用户
★★
Credits 616
Posts 187
Joined 2003-04-18 00:00
23-year member
UID 1598
Gender Male
Status Offline
This is a repeated question; I've already replied to it many times.

If you already know how to use a boot floppy to make a bootable CD, and just don't know how to automatically switch to the CD drive letter after booting,
then you only need to solve the problem of finding the CD-ROM drive letter.
There are two methods:

1. Specify the CD-ROM drive letter: at the end of the line with MSCDEX.EXE in AUTOEXEC.BAT on the boot floppy, add /L:X (X can be replaced with another letter). Note that CONFIG.SYS should contain this line: LASTDRIVE=Z
This method is simple and easy to use; beginners are advised to use it.

2. Use FINDCD.EXE to find the CD-ROM drive letter. This method is a bit more complicated; you can refer to the Super Moderator's MSDOS7.10 super boot disk and PWIN98's boot disk.

After deciding which method to use, add one more line at the end of AUTOEXEC.BAT on the boot floppy:
X: (first method)
or
%CDROM%: (second method)

Then after booting, it will enter the CD-ROM drive letter (of course, the drive letter of the first CD-ROM drive).

You can test it with a floppy disk first, and burn the CD after it works.

If you still don't know how to use a boot floppy to make a bootable CD, then first look through the old posts, learn that, and then do the above.

After saying so much, if you still don't understand, then use the simplest method:

Use PWIN98's boot floppy, and add one line at the end of AUTOEXEC.BAT on the boot floppy:
%CDROM%:
Then use this boot floppy to make a bootable CD.
Floor 5 Posted 2003-07-27 00:00 ·  中国 福建 南平 电信
初级用户
Credits 197
Posts 33
Joined 2003-07-24 00:00
23-year member
UID 7424
Gender Male
Status Offline
But what if there is more than one CD-ROM drive! Then this still can't automatically find which drive the disc is in!
Forum Jump: