@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in ('dir/b/o-d *.txt') do (
set s=%%i
set s=!s:~,8!
if defined #!s! (del %%i) else set #!s!=1
)
if not exist OLD md OLD
for /f "delims=" %%f in ('dir /b *.txt') do (set a=%%f
set #%a:~0,8%=%a:~0,8%)
for /f "tokens=2 delims=^=" %%f in ('set #') do (
for /f "skip=1 delims=" %%x in ('dir /b /o-d %%f*.txt') do move %%x OLD\)