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-24 23:16
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » Memory Disk and CD-ROM Drive Letter Issues in Batch Files View 825 Replies 5
Original Poster Posted 2005-03-29 00:00 ·  中国 安徽 宿州 电信
银牌会员
★★★
Credits 1,339
Posts 595
Joined 2004-05-26 00:00
22-year member
UID 25306
Gender Male
From 安徽 宿州
Status Offline
In batch files, we always define the drive letters for the memory disk and CD-ROM first, and then use them. For example, Set ramdrive= and Set cdrom=, then use Xmsdskt to create the memory disk, load the Vide-cdd.sys CD-ROM driver in Config.sys, load the shsucdx.exe CD-ROM extension driver in Autoexec.bat, and then use Findramd and Findcd to find the drive letters of the memory disk and CD-ROM, setting the path as: Path %ramdrive%\;%cdrom%\。But in some boot disks, %ramdrive% and %cdrom% have to be followed by a colon (, that is, like this: Path %ramdrive%:\;%cdorm%。
My question is: when exactly should there be a colon (, and when should there not be a colon (?
Floor 2 Posted 2005-03-29 00:00 ·  中国 广东 广州 海珠区 电信
金牌会员
★★★★
D◎$ Fαп
Credits 4,562
Posts 1,883
Joined 2004-01-19 00:00
22-year member
UID 15812
Gender Male
From 广东广州
Status Offline
It depends on the program used to find the drive letter! Wengier's findcd.exe program automatically stores the drive letter and colon in the %cdrom% environment variable. But Win98's findramd batch program only stores the virtual disk drive letter in %ramdrive%, without the colon, so the path line has to add the colon. You should know that these %xxxx% environment variables are essentially just strings. Whenever a command containing environment variables is executed, DOS automatically "restores" the environment variables into strings. For example: when executing Path %ramdrive%\;%cdrom%, if the virtual disk drive letter is G: and the CD-ROM is H:, then the command is actually executing path g:\;h:
----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
Floor 3 Posted 2005-03-30 00:00 ·  中国 上海 徐汇区 电信
银牌会员
★★★
永遠的DOS~~~
Credits 1,200
Posts 466
Joined 2005-02-01 00:00
21-year member
UID 35867
Gender Male
From 上海
Status Offline
Win98's one is %ramd%, and it does not include the colon. Whether to add %cdrom% in path is up to you. I just don't like adding a: and %cdrom% to path, because if the required command is not in the ramdisk, it will automatically go to a: and cdrom to look for it, which instead reduces system efficiency.
32位才是DOS未来的希望
个人网志:http://sololand.moe
Floor 4 Posted 2005-03-31 00:00 ·  中国 安徽 宿州 泗县 电信
银牌会员
★★★
Credits 1,339
Posts 595
Joined 2004-05-26 00:00
22-year member
UID 25306
Gender Male
From 安徽 宿州
Status Offline
With or without the colon is not the same. Suppose you use Finfcd to find the CD-ROM drive letter and it is drive G. If you do not include the colon, then Path %cdrom%\ becomes Path G\ , and that won't work; on the other hand, if you include the colon, Path %cdrom%:\ becomes Path G:\, and that will work.
Floor 5 Posted 2005-04-02 00:00 ·  中国 河北 石家庄 联通
初级用户
Credits 177
Posts 22
Joined 2004-04-26 00:00
22-year member
UID 23320
Gender Male
Status Offline
Why not use shsucdx.exe to specify the drive letter? I just set the CD to z:\
Floor 6 Posted 2005-04-05 00:00 ·  中国 安徽 宿州 电信
银牌会员
★★★
Credits 1,339
Posts 595
Joined 2004-05-26 00:00
22-year member
UID 25306
Gender Male
From 安徽 宿州
Status Offline
Of course you can specify the CD-ROM drive letter and the memory disk drive letter, but I prefer my way.
Forum Jump: