Here's how you can do it in batch (in case you're curious). The big limitation is that if you have filenames with more than one percent sign, it won't work because the shell expands it to a variable. I don't know immediately how to fix that.
It starts from whatever directory the script is in, and works recursively over all subdirectories.
@echo off
setlocal enabledelayedexpansion
for /f "usebackq delims=" %%N in (`dir /s /b`) do (
set var=%%~nN
set var=!var:^&= !
set var=!var:%%= !
if not "!var!"=="%%~nN" (
if not exist "%%~dpN!var!%%~xN" (
echo "%%N" --^> "!var!%%~xN"
ren "%%N" "!var!%%~xN"
) else (
echo File "!var!%%~xN" ^(from %%N^) already exists.
)
)
)
E.g., prints output like this:
C:\batch\schar>schar
"C:\batch\schar\Test%doc.doc" --> "Test doc.doc"
"C:\batch\schar\Test%doc.pdf" --> "Test doc.pdf"
File "Test doc.pdf" (from C:\batch\schar\Test&doc.pdf) already exists.
"C:\batch\schar\subdir\FILE%here" --> "FILE here"