1. ren重命名

  1. @echo off
  2. echo > a.txt
  3. set DIR=%cd%
  4. set DIR=%DIR%
  5. for /r . %%i in (.) do (
  6. echo %%i >> a.txt
  7. )
  8. find "P&ID" a.txt > b.txt
  9. find "IFD" b.txt > c.txt
  10. for /F "skip=2 delims=" %%a in (c.txt) do (
  11. pushd %%a
  12. set x=%%a
  13. set x=!x:~0,-1!
  14. echo %x%
  15. rem echo %%a
  16. rem for /r . %%b in (*.pdf) do (
  17. rem echo %%b
  18. rem )
  19. rem for /F %%b in ('dir *.pdf /b') do (
  20. rem set c=%%b
  21. rem set d=%c:~0,-1%
  22. rem echo %d%
  23. rem echo %%b
  24. set i=\
  25. rem echo %%a%i%%%b
  26. rem xcopy %%a%%b %DIR%%i%%%b /i
  27. rem )
  28. rem popd
  29. )
  30. pause