diff --git a/src/xpdev/dirwrap.c b/src/xpdev/dirwrap.c
index ca2f10ba4090ebc15b01021518b2cfc491fab7f4..44122d0e70b927920940b4cc686ff11f34a3e0bd 100644
--- a/src/xpdev/dirwrap.c
+++ b/src/xpdev/dirwrap.c
@@ -68,6 +68,7 @@
 
 #include "genwrap.h"	/* strupr/strlwr */
 #include "dirwrap.h"	/* DLLCALL */
+#include "filewrap.h"	/* filetime() */
 
 #if !defined(S_ISDIR)
 	#define S_ISDIR(x)	((x)&S_IFDIR)
@@ -1221,6 +1222,7 @@ BOOL CopyFile(const char* src, const char* dest, BOOL failIfExists)
 		return FALSE;
 	}
 
+	time_t	ftime = filetime(fileno(in));
 	while(!feof(in)) {
 		size_t rd = fread(buf, sizeof(uint8_t), sizeof(buf), in);
 		if(rd < 1)
@@ -1234,6 +1236,7 @@ BOOL CopyFile(const char* src, const char* dest, BOOL failIfExists)
 
 	fclose(in);
 	fclose(out);
+	setfdate(dest,ftime);
 
 	return success;
 }