Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.