@echo off
if "%OS%" == not "Windows_NT" goto done
title Reset DOSBox configuration
if not exist "Run DOSBox configuration.bat" goto done
if not exist .\common\config_template\dosbox_ddraw.conf goto done
if not exist .\common\config_template\dosbox_default.conf goto done
if not exist .\common\config_template\dosbox_direct3d.conf goto done

if not exist ..\dosbox.conf goto run_config
:ask
cls
set me=
echo NOTE! dosbox.conf exists.
set /p me=Do you want to reset your DOSBox configuration ([Y]es / [N]o)?
if /I "%me%" == "y" goto del_conf
if /I "%me%" == "n" goto done
goto ask

:del_conf
del ..\dosbox.conf
if exist ..\dosbox.conf attrib -r -h -s ..\dosbox.conf && del ..\dosbox.conf
if exist ..\dosbox.conf goto error
goto run_config

:run_config
"Run DOSBox configuration.bat"
goto done

:error
pause >nul
goto done

:done
set me=
