@echo off
if "%OS%" == not "Windows_NT" goto done
set configfile=.\Tools\config_template\dosbox_direct3d.conf
cd ..
cls
title DOSBox Configuration
if not exist dosbox.conf goto create_conf
:start
if exist "%WINDIR%\notepad.exe" goto open_conf
if exist "%SystemRoot%\system32\notepad.exe" goto open_conf
echo Couldn't find notepad.exe in your system.
pause >nul
goto done

:open_conf
echo Opening DOSBox Configuration...
if exist "%WINDIR%\notepad.exe" "%WINDIR%\notepad.exe" dosbox.conf && goto done
if exist "%SystemRoot%\system32\notepad.exe" "%SystemRoot%\system32\notepad.exe" dosbox.conf && goto done
goto done

:create_conf
cls
echo Creating new DOSBox Configuration...
if not exist %configfile% goto done
copy %configfile% .\dosbox.conf >nul
if exist stdout.txt del stdout.txt
if exist dosbox.conf goto start
goto done

:done
