问个问题,你这个条件是查找的范围是子目录一个目录下吗?
@echo off
cd test
for /r %%i in (.) do (
call:fun "%%i"
)
exit
:fun
cd %1
for /f "delims=" %%i in ('dir *.aaa /a-d /b') do (
if not exist "%%~ni.bbb" (del "%%~ni.aaa")
)
goto:eof
--
我就呵呵了,你会你还提问。浪费感情~
@echo off
setlocal enabledelayedexpansin
for /r c:\test %%a in (*.aaa) do (
set fn=%%~nxa
set fn=!fn:~0,-4!
dir /s /b c:\test\!fn!.bbb||del "%%~fa"
)