Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://www.tenforums.com/general-support/69943-date-last-modified-year-field-set-year-2036-some-files.html
- $path="D:\Whatever Directory"
- $today = (Get-Date)
- $future = (Get-Date 2036-01-01)
- Get-ChildItem $path -r |
- ForEach-Object {
- if ((Get-Date $_.LastWriteTime) -ge $future) {
- $_.CreationTime = $today
- $_.LastAccessTime = $today
- $_.LastWriteTime = $today
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement