-@echo>version.h #define NSSM_VERSION _T("%description%")\r
-@echo>>version.h #define NSSM_VERSIONINFO %major%,%minor%,%n%,%BUILD_NUMBER%\r
-@echo>>version.h #define NSSM_DATE _T("%DATE%")\r
+@echo>version.h.new #define NSSM_VERSION _T("%description%")\r
+@echo>>version.h.new #define NSSM_VERSIONINFO %major%,%minor%,%n%,%BUILD_NUMBER%\r
+@echo>>version.h.new #define NSSM_DATE _T("%DATE%")\r
+@echo>>version.h.new #define NSSM_FILEFLAGS %flags%\r
+@echo>>version.h.new #define NSSM_COPYRIGHT _T("Public Domain; Author Iain Patterson 2003-%year%")\r
+\r
+fc version.h version.h.new >NUL: 2>NUL:\r
+if %ERRORLEVEL% == 0 (del version.h.new) else (move /y version.h.new version.h)\r