谁能把这些代码合并为一行?(有特殊原因的限制,必须合并为一行)-
- @echo off&setlocal ENABLEDELAYEDEXPANSION
- set "file_path=C:\Users\test\Desktop\123\"
- echo.&echo 正在建立扫描列表,请稍候...&echo.&(for /f "delims=*" %%i in (old.txt) do set "%file_path%%%i=old")&echo 正在扫描:%%i .....OK!&cls&echo.&echo 正在进行文件核查,请稍候...&echo.&(for /f "delims=*" %%i in ('dir "%file_path%" /a-d /s /b') do echo 已核查:%%i .....OK!&if defined %%i (set "%%i=ok") else (set "%%i=new"))&set %file_path% | findstr /v "=ok$" >nul ||(cls&echo.&echo;完全一样。&echo.&pause&exit)&cls&echo.&(choice.exe "是否查看不同变化的文件?")&(IF not %ERRORLEVEL% equ 0 exit)&echo.&echo;新增文件列表:&(for /f "delims==" %%i in ('set %file_path% ^| findstr "=new$"') do echo;%%i)&echo.&echo;缺失文件列表:&(for /f "delims==" %%i in ('set %file_path% ^| findstr "=old$"') do echo;%%i)&echo.&pause
复制代码
[ 本帖最后由 alpha 于 2010-8-1 13:12 编辑 ] |