07-23-2023, 09:34 AM
Use REG to save/modify/restore what ever values are most useful for your bat file. This is windows 7, for other versions you may need a different key name.
reg save "HKEY_CURRENT_USER\Control Panel\International" _tmp.reg /y
reg add "HKEY_CURRENT_USER\Control Panel\International" /v sShortDate /d "yyyy-MM-dd" /f
set file=%DATE%-%TIME: =0%
reg restore "HKEY_CURRENT_USER\Control Panel\International" _tmp.reg
set file=%file::=-%
set file=%file:.=-%
set file
reg save "HKEY_CURRENT_USER\Control Panel\International" _tmp.reg /y
reg add "HKEY_CURRENT_USER\Control Panel\International" /v sShortDate /d "yyyy-MM-dd" /f
set file=%DATE%-%TIME: =0%
reg restore "HKEY_CURRENT_USER\Control Panel\International" _tmp.reg
set file=%file::=-%
set file=%file:.=-%
set file