Why Does the Date Change? When you copy or move files in Windows, sometimes the Date Created changes, but the Date Modified (the last tim...
Why Does the Date Change?
When you copy or move files in Windows, sometimes the Date Created changes, but the Date Modified (the last time the file’s contents were edited) should normally stay the same. However, if you want to make sure your timestamps are preserved, here are the best methods.
Method 1: Move Within the Same Drive
If you use Cut (Ctrl + X) and Paste (Ctrl + V), or drag-and-drop within the same drive or partition:
- Date Modified → stays the same ✅
- Date Created → may change ❌
So this works fine if you’re just moving files inside the same hard drive.
Method 2: Use XCOPY Command
If you’re copying files to a different drive, use XCOPY in Command Prompt. Open CMD and type:
xcopy "C:\Source\*" "D:\Destination\" /E /I /H /K /X /Y
This command will:
/E
→ copy all subfolders/H
→ include hidden files/K
→ keep file attributes/X
→ keep permissions and timestamps
Method 3: Use Robocopy (Best Option)
Robocopy is the most reliable tool for keeping timestamps. Run this in Command Prompt:
robocopy "C:\Source" "D:\Destination" /E /COPYALL /DCOPY:T
Here’s what it does:
/E
→ copies all folders and subfolders/COPYALL
→ copies data, attributes, permissions, and timestamps/DCOPY:T
→ keeps folder dates
This is the safest method if you’re making backups or moving important data.
Method 4: PowerShell Script
If you prefer PowerShell, run this command:
Copy-Item "C:\Source\*" -Destination "D:\Destination\" -Recurse -Force -PassThru | % { $_.LastWriteTime = (Get-Item $_.FullName).LastWriteTime }
This ensures the Date Modified (LastWriteTime) does not change after copying.
✅ Final Tips
- Moving inside the same drive → safe, no “Date Modified” change.
- Copying across drives → use Robocopy for best results.
- XCOPY and PowerShell are good alternatives if Robocopy is not available.
👉 Next time you move files, use these commands to keep your original timestamps safe.
No comments