[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
有可能是代码的作者写错了呢
1

评分人数

TOP

回复 4# freesoft00


不考虑文本中的感叹号的话,下面两种写法作用相同:
call set "str=%%str:*:=%%"
set "str=!str:*:=!"

星号在字符串替换中的作用:

    %PATH:str1=str2%

would expand the PATH environment variable, substituting each occurrence
of "str1" in the expanded result with "str2".  "str2" can be the empty
string to effectively delete all occurrences of "str1" from the expanded
output.  "str1" can begin with an asterisk, in which case it will match
everything from the beginning of the expanded output to the first
occurrence of the remaining portion of str1.

TOP

回复 5# freesoft00


    第二行的作用是:变量初始化

TOP

回复 9# freesoft00


不知道你怎么测试的
C:\>set str=sdfalsdf:www
C:\>set str=%str:*:=%
C:\>echo %str%
www
1

评分人数

TOP

回复 11# freesoft00


    %*表示所有的位置参数,因为那个代码要处理多个chm文件

TOP

返回列表