
CODE: [Copy to clipboard]@echo off
setlocal enabledelayedexpansion
for /f "skip=7 tokens=3,4" %%a in ('dir b') do (
set typeb=%%a
set nameb=%%b
if exist "a\!nameb!" (
for /f "skip=5 tokens=3" %%i in ('dir "a\!nameb!"') do (
set typea=%%i
if /I "!typea!"=="<dir>" (
echo Deleting dir "a\!nameb!"
rd /q /s "a\!nameb!" >nul
) else (
echo Deleting file "a\!nameb!"
del /q /s "a\!nameb!" >nul
)
)
)
)
pause
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |