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 17:08
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » Question about BAT files View 708 Replies 4
Original Poster Posted 2004-08-04 00:00 ·  中国 天津 教育网
初级用户
Credits 126
Posts 7
Joined 2004-08-02 00:00
21-year member
UID 29498
Gender Male
Status Offline
:loop
if errorlevel %1 goto no_shift
:do_shift
set cdrom=%2
shift
shift
if not %1*==* goto loop
goto no_ramdrive
Can someone give a detailed explanation? This is from SETRAMD.BAT on the 98 boot disk.
Thanks in advance
Floor 2 Posted 2004-08-04 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
These few lines are for finding the drive letter of the virtual hard disk; only by looking together with autoexec.bat can you know their whole background. Indeed, these few lines are written so~~~terse!!! Just a few batch statements, and by using shift and a loop they actually outperform an assembly program! Impressive! I need to study this seriously too。。。。。。
----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
Floor 3 Posted 2004-08-04 00:00 ·  中国 辽宁 抚顺 联通
银牌会员
★★★
Credits 1,186
Posts 510
Joined 2004-07-30 00:00
21-year member
UID 29279
Gender Male
Status Offline
Wow! So BAT can be this powerful too!
Floor 4 Posted 2004-08-07 00:00 ·  中国 广西 贺州 电信
初级用户
Credits 168
Posts 16
Joined 2004-06-01 00:00
22-year member
UID 25823
Gender Male
Status Offline
What is shift used for here?
Floor 5 Posted 2004-08-08 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
Shift moves all command-line parameters one place to the left. For example, if there are five parameters, %1 %2 %3 %4 %5, after one shift they become %2 %3 %4 %5, and after another shift they become %3 %4 %5, and so on.
----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
Forum Jump: