This is a trick question, right? Using your example, the code will crash and burn with duplicate file names.

@echo off
for /f "tokens=1-2 delims=." %%a in ('dir /b dirname') do (
for /f "tokens=1-6" %%i in ("%%a") do (
for /f %%x in ("%%b") do (
ren "dirname\%%a.%%b" %%i%%j%%k%%l%%m%%n.%%x
)
)
)
Replace
dirname with a valid value. This will work for up to six embedded spaces. If you suspect you have more, change accordingly.
Happy Computing...
