- @echo off
- set str=c d e f g a
- echo 当前的硬盘的分区有:
- for %%i in (%str%) do if exist %%i: echo %%i:
- pause
- echo 显示F盘下所有的文件夹和文件并分宽列出来
- cd..\..
- cd /d e:\.&dir /s/a/w
- pause
- @echo off
- for %%i in (e:\test1\*.txt test2\*.txt) do echo %%i
- pause
- @echo off
- for %%i in (e:\test1.\*.txt test2\*.txt) do type %%i
- pause
- @echo off
- for %%i in (e:\test1.\*.txt test2\*.txt) do more %%i
- pause
- @echo off
- for /f "delims=," %%i in (e:\test2\3.txt) do echo %%i
- pause
- @echo off
- for /f %%i in (e:\test1\1.txt) do echo %%i
- pause
复制代码 写这段代码用了2个小时,还是感觉不够完整,FOR语句还是不够掌握,SET也没用上,
等想好了再发上来。 |