打印

[求助] 求解:me启动盘setramd.bat中的if not %1*==* goto loop是什么意思?

本主题由 mwpq 于 2007-11-8 09:52 关闭

求解:me启动盘setramd.bat中的if not %1*==* goto loop是什么意思?

哪位高手能解释一下if not %1*==* goto loop里的%1*==*是什么意思啊,我看不大明白了。

TOP

原脚本是这样的

复制内容到剪贴板
代码:
@echo off
set RAMD=
set CDROM=

echo.
echo Preparing to start your computer.
echo This may take a few minutes. Please wait...
echo.

Ctest\findramd

if errorlevel 255 goto no_ramdrive

if not errorlevel 3 goto no_ramdrive

goto do_shift

:loop
if errorlevel %1 goto no_shift

:do_shift
set cdrom=%2
shift
shift
if not %1*==* goto loop
goto no_ramdrive

:no_shift
set ramd=%2

if "%RAMD%"=="C" goto c_drive

goto success

:c_drive
echo Windows 98 has detected that drive C does not contain a valid FAT or
echo FAT32 partition. There are several possible causes.
echo.
echo 1. The drive may need to be partitioned. To create a partition on the drive,
echo run FDISK from the MS-DOS command prompt.
echo.
echo 2. You may be using third-party disk-partitioning software. If you are using
echo this type of software, remove the Emergency Boot Disk and restart your
echo computer. Then, follow the on-screen instructions to start your computer from
echo a floppy disk.
echo .
echo 3. Some viruses also cause your drive C to not register. You can use a virus
echo scanning program to check your computer for viruses.
echo.
goto success

:no_ramdrive
echo The Windows 98 startup disk could not create a temporary drive for the
echo diagnostic tools. This may be because this computer has less than the
echo minimum required extended memory.
echo.
:success
[ 本帖最后由 mwpq 于 2007-11-6 12:21 编辑 ]

TOP

我对批处理不熟悉,你可以到专门的批处理论坛讨论一下。
《无量寿经·第十八愿》言:
设我得佛,十方众生,至心信乐,欲生我国,乃至十念,若不生者,不取正觉。唯除五逆,诽谤正法。

TOP

在网上找了一下,无忧启动论坛的一个会员在2005年问过这个问题,可是那个论坛的版主也没有给出正面回答~~~晕倒,( G K Y w0 A7 ~! _5 p

. m0 c x7 N+ p% Z P9 W, ~6 s t
) o1 u8 o4 Z" _让我研究一下批处理先
考完试鸟,心力憔悴呀~~~~接下来,准备补考

TOP

在DOS论坛联盟中问了一下,答案如下9 I# \, ]! M) t. ~2 s# s) J4 S2 Z

/ H, ^2 h c2 D( Z" L%1*==*等价于%1==,
- E- D, Z6 _; Y" ^: e0 E
* w/ r$ R, b; H% N如果有一边数据为空,==判断程序出错,两边所以加上一些相同字符避免出错 ^+ t3 a0 z ~" _( D( h
) d/ Q7 D- ?! c! W
总的意思就是是否%1为空。
本帖最近评分记录
  • mwpq 菊花元 +10 well done 2007-11-7 05:57
考完试鸟,心力憔悴呀~~~~接下来,准备补考

TOP

98SE的我研究过: n L- W9 Q. B% G
这段批处理用来寻找虚拟盘的盘符,shift用来修改变量,/ y# y: J: t; l: ]; S
注意前面有个
! k2 x. w: p# iset LglDrv=27 * 26 Z 25 Y 24 X 23 W 22 V 21 U 20 T 19 S 18 R 17 Q 16 P 15
6 h2 k* P3 ~7 _1 N0 lset LglDrv=%LglDrv% O 14 N 13 M 12 L 11 K 10 J 9 I 8 H 7 G 6 F 5 E 4 D 3 C& l, Q2 j7 J( @
就是C-Z% V7 e! S: R+ J5 @
然后作为参数传递给setramd3 S2 Q# L6 o1 d! q% O
call setramd.bat %LglDrv%
# f- c7 C( `9 N+ c这个批处理分别比较这些盘符,直到找到虚拟盘为止,同时搞定光驱盘符。
4 j( V! ^8 |" m0 K3 u楼主可以shinft+F8单步执行考究一下。
本帖最近评分记录
  • mwpq 菊花元 +10 very helpful 2007-11-7 05:58
欢迎大家到认证区参与考试题目知识探讨,提问有奖励,解答更有奖励。
电脑培训教师交流群:40351571

TOP