Skip to content

Instantly share code, notes, and snippets.

@Intey
Created July 3, 2014 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Intey/b4cbeb2971a1586a55f8 to your computer and use it in GitHub Desktop.
Save Intey/b4cbeb2971a1586a55f8 to your computer and use it in GitHub Desktop.
delete pattern from each file in current directory(recursively).
@echo off
Setlocal enabledelayedexpansion
echo %filePath%
Set "pattern=.paycrypt@gmail_com"
Set "replace="
echo "replace" %replace%
echo "Pattern " %pattern%
for /f "usebackq tokens=* delims=" %%# in (`dir /b /S /A:-D`) Do (
Set "File=%%~nx#"
ren "%%#" "!File:%pattern%=%replace%!"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment