联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
Originally posted by electronixtar at 2007-3-16 10:47 PM: 都中级用户了,还取这么个帖子标题。
Originally posted by NaturalJ0 at 2007-3-17 12:40 AM: call echo The OEM value is %%!OEM!%%
C:\Documents and Settings\J\桌面>type a.bat&echo =======================&a @echo off setlocal ENABLEDELAYEDEXPANSION set asus=_ASUS_ set lenovo=_LENOVO_ set sony=_SONY_ set OEM=asus for %%i in (asus lenovo sony) do ( set OEM=%%i call echo The OEM value is %%!OEM!%% rem 以下对 !%OEM%! 进行处理 ) pause exit ======================= The OEM value is _ASUS_ The OEM value is _LENOVO_ The OEM value is _SONY_ 请按任意键继续. . .
Originally posted by NaturalJ0 at 2007-3-17 02:48 AM: 实际运行结果如下: C:\Documents and Settings\J\桌面>type a.bat&echo =======================&a @echo off setlocal ENABLEDELAYEDEXPANSION set asus=_ASUS_ set le ...
C:\Documents and Settings\J\桌面>type a.bat&echo =======================&a @echo off setlocal ENABLEDELAYEDEXPANSION set asus=_ASUS_ set le ...
Originally posted by NaturalJ0 at 2007-3-17 06:07 AM: call set ...
Originally posted by willsion at 2007-3-16 09:24: @echo off setlocal ENABLEDELAYEDEXPANSION set asus=_ASUS_ set lenovo=_LENOVO_ set sony=_SONY_ set OEM=asus for %%i in (asus lenovo sony) do ( set OEM=%%i echo The OEM value is ...
for %%i in (!asus! !lenovo! !sony!) do ( echo The OEM value is %%i )
@echo off set asus=_ASUS_ set lenovo=_LENOVO_ set sony=_SONY_ for %%i in (%asus% %lenovo% %sony%) do ( echo The OEM value is %%i ) pause exit