I am renaming a bunch of files that begin with TB-Practice
to begin with P-
.
So far I have this batch
pushd %~dp0
for %%i in ("TB-Practice*.pdf") do (set fname=%%i) & call :rename
goto :eof
:rename
::Cuts off 1st eleven chars, then appends prefix
::P- is put in front of the file name
ren "%fname%" "P-%fname:~11%"
goto :eof
Unfortunately instead of ending up with P-Filename
I end up with P- Filename
which is incompatible with the current format I'm using for these files.
What am I doing wrong? There isn't a space anywhere when declaring the variables.