@echo off

title %~nx0
setlocal
set /a numProcs = 0
for /f %%a in ('tasklist /nh /fi "windowtitle eq %~nx0"') do (
	set /a numProcs += 1
)
if not %numProcs% == 1 (
	echo Another instance of this batch file is already running.
	exit /b 1
)
for %%f in (*.versionUpdate) do set recent=%%f
for /F "tokens=1,2,3,4" %%a in (%recent%) do (
	ren %%a %%b
	ren %%c %%d
	)
for %%f in (*.versionUpdate) do del %%f