本帖最后由 pcl_test 于 2016-9-24 12:06 编辑
- @ECHO OFF
- SETLOCAL ENABLEDELAYEDEXPANSION
- for /f "tokens=*" %%a in ('dir/a-d/b/oe') do set/a c+=1&set a!c!=%%a&set b!c!=%%~za&set c!c!=%%~xa
- for /l %%a in (1,1,%c%) do set/a d=%%a+1&for /l %%b in (!d!,1,%c%) do if not !b%%a!.==. call :1 %%a %%b
- goto :eof
- :1
- if !b%1!==!b%2! if !c%1!==!c%2! set b%2=&del "!a%2!"
- goto :eof
复制代码 怎样才能如果两个文件的类型和大小都一样,那两个都删除呢? |