1,- @echo off&setlocal enableDelayedExpansion
- for %%a in (*.txt) do set a=%%a&echo !a:~0,1!
- pause
复制代码 2,如果要显示新定义的变量:- @echo off
- set List1=视频:avi:mpg:3gp
- set List2=音频:wma:mp3:wav
- set List3=压缩:zip:rar:7z
- set List4=图片:jpg:bmp:png
- set List
- pause
复制代码 如果要解析新定义的变量:- @echo off
- set List1=视频:avi:mpg:3gp
- set List2=音频:wma:mp3:wav
- set List3=压缩:zip:rar:7z
- set List4=图片:jpg:bmp:png
- FOR /F "tokens=1-5 delims==:" %%i IN ('set List') DO echo %%i %%j %%k %%l %%m
- pause
复制代码
[ 本帖最后由 hanyeguxing 于 2011-1-3 10:50 编辑 ] |