Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my windows-7 PC due to cmos battery failure I have to set date time.But i did wrongly i.e set 14th August instead of 13th August. And I found very late after a lot of work done.

Now I want to change the all timestamps(created date, modified date, ..) of all files in the whole system that touched today(created date of all files which created today,modified date of
all files modified today) to correct date

It would be better atleast to change timestamp of my working files(folders, archived files, .Net related files such as c# source code files, aspx files, sln files ,etc..,)

Any script or command utility available in PowerShell or any thing on Windows 7 to subtract one day from timestamps of files touched today

Secondary question: Is it possible to change all history, bookmarks items' timestamp of a browser like Google chrome simillarly?

share|improve this question
Just use the datemodified: using the built-in search within Windows. – Ramhound Aug 13 '12 at 10:41

found out after lot of googling

$SubtractDays = New-Object System TimeSpan 1,0,0,0,0
(Get-ChildItem D:\ -Recurse | Where {($_.LastWriteTime).date -eq (Get-Date).date})| ForEach-Object {$_.LastWriteTime = $_.LastWriteTime.Subtract($SubtratDays)}
(Get-ChildItem D:\ -Recurse | Where {($_.CreationTime).date -eq (Get-Date).date})| ForEach-Object {$_.CreationTime = $_.CreationTime.Subtract($SubtratDays)}
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .