那是这个吗?
CrLf 发表于 2011-11-15 00:37
谢谢!
单纯echo是对的,但是为什么下面代码不对?- @echo off
- setlocal ENABLEDELAYEDEXPANSION
- for /f "delims=" %%a in (文件夹名称1.txt) do (
- set VAR=%%a
- for /f "delims=" %%k in ('dir /s/b/a-d E:\JP-XIN\*.pdf E:\JP-XIN\*.txt ^| findstr /i "!VAR!"') do (
- for /f "delims=" %%l in ('dir /s/b/a:d-h E:\ ^| findstr /i "!VAR!" 2^>nul') do (
- if not "%%l"=="" move "%%k" "%%~fsl" >nul 2>nul
- )))
- pause
复制代码
|