@echo off
if exist cfg\rallyx.cfg move cfg\rallyx.cfg cfg\rallyx.bak
if exist hi\rallyx.hi move hi\rallyx.hi hi\rallyx.bak
if exist nvram\rallyx.nv move nvram\rallyx.nv nvram\rallyx.bak
if exist diff\rallyx.dif move diff\rallyx.dif diff\rallyx.bak

mame rallyx -record rallyx.inp %3 %4 %5 %6 %7 %8 %9 -nvram_directory NUL

if exist cfg\rallyx.bak move cfg\rallyx.bak cfg\rallyx.cfg
if exist hi\rallyx.bak move hi\rallyx.bak hi\rallyx.hi
if exist nvram\rallyx.bak move nvram\rallyx.bak nvram\rallyx.nv
if exist diff\rallyx.bak move diff\rallyx.bak diff\rallyx.dif
