From 1b4bdcfabe6d618548114fecba93c8188fb4a7dc Mon Sep 17 00:00:00 2001 From: DannyArends Date: Wed, 28 Feb 2018 15:38:31 +0100 Subject: Windows script to generate src/version.h --- scripts/gen_version_info.cmd | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 scripts/gen_version_info.cmd diff --git a/scripts/gen_version_info.cmd b/scripts/gen_version_info.cmd new file mode 100644 index 0000000..d824687 --- /dev/null +++ b/scripts/gen_version_info.cmd @@ -0,0 +1,16 @@ +@echo off +rem https://stackoverflow.com/questions/3472631/how-do-i-get-the-day-month-and-year-from-a-windows-cmd-exe-script +FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO ( + if "%%B" NEQ "" ( + SET /A FDATE=%%F*10000+%%D*100+%%A + ) +) +set year=%FDATE:~0,4% +set /p version=