@echo off

set dir=%~dp0%
cd /d %dir%

mode con:cols=30 lines=2

title Paint creator

echo Name (optional)
set suffix=
set /p suffix="> "

rem add a space before the suffix if there is one for padding
if not "%suffix%"=="" (
	set suffix= %suffix%
)

rem use some weird splicing to generate a date
set filename=%date:~10,4%-%date:~4,2%-%date:~7,2%%suffix%.bmp


rem old code that just made an empty bitmap
rem rem weird hack to get an empty string https://stackoverflow.com/a/35219622
rem echo | set /p dummyName="" >> "%filename%"

rem we use a template now
copy template.bmp "%filename%"

rem launch paint
start c:\winnt\system32\mspaint.exe "%filename%"

rem add to readme.txt
echo,>> readme.txt
echo ### %filename%>> readme.txt
echo,>> readme.txt

rem launch notepad
start c:\winnt\system32\notepad.exe readme.txt