Hi there, I created the following batch file for Windows 7 based on another member's old solution (i.e. related thread is now closed): @echo off
cls
setlocal enabledelayedexpansionfor /f "tokens=1* delims= " %%1 in ('dir /b *.epub') do (
set oldfilename=%%1 %%2
set newfilename=%%2
echo Oldfilename=!oldfilename!
echo Newfilename=!newfilename!
pause>nul
echo.&echo.
ren !oldfilename! !newfilename!
)
When listing the proposed changes, the echoed newfilename is exactly what I want but the OS comes up with "The syntax of the command is incorrect" when it reaches the REN line. What am I doing wrong????Thanks!