中国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-27 16:45
47,815 topics / 349,928 posts / today 0 new / 48,289 members
DOS启动盘 & LOGO技术 (启动盘室) » Question about BAT files
Printable Version  837 / 4
Floor1 beidouking Posted 2004-08-04 00:00
初级用户 Posts 7 Credits 126
: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
Floor2 JonePeng Posted 2004-08-04 00:00
金牌会员 Posts 1,883 Credits 4,562 From 广东广州
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。。。。。。
Floor3 wchong Posted 2004-08-04 00:00
银牌会员 Posts 510 Credits 1,186
Wow! So BAT can be this powerful too!
Floor4 je64 Posted 2004-08-07 00:00
初级用户 Posts 16 Credits 168
What is shift used for here?
Floor5 JonePeng Posted 2004-08-08 00:00
金牌会员 Posts 1,883 Credits 4,562 From 广东广州
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.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023