Advertisement
Javi

.bat to strip part of the name of a buch of files in a folde

Oct 5th, 2012
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.33 KB | None | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set deletestring=[www.lokotorrents.com]
  4. echo Ready to start
  5. echo.
  6. pause
  7. echo.
  8. for /f "delims==" %%F in ('dir /b ^| find "%deletestring%"') do (
  9.     set oldfilename=%%F
  10.     set newfilename=!oldfilename:%deletestring%=!
  11.         Ren "!oldfilename!" "!newfilename!"
  12.     )
  13. echo.
  14. echo All done
  15. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement