Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Change Modified Date on thousands of Files in Windows by 1 hour

Posted on 2014-03-13
3
Medium Priority
?
362 Views
Last Modified: 2014-03-31
The time date stamp on my backup drive is wrong by 1 hour.  I want to subtract 1 hour from the stamp on over 10,000 files.

I found BulkFileChanger @ nirsoft.net, but this is too many files for it.

What is the best way to get this done. A batch file or powershell command line script would be perfect. I'll take any solution that works.

Thank you!
0
Comment
Question by:JohnMan777
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 2000 total points
ID: 39928497
gci "X:\your\path" | % {$_.LastWriteTime = $_.LastWriteTime.addHours(-1)}

Open in new window

or, if you want to modify the creation time:
gci "X:\your\path" | % {$_.CreationTime = $_.CreationTime.addHours(-1)}

Open in new window

HTH,
Dan
0
 

Author Closing Comment

by:JohnMan777
ID: 39967631
Dan,

I apologize for the slow response on this.

Although I was not able to verify that the solution works, it looks very promising.

I found some free utilities that did get the job done. They are "Bulk File Changer" and "fsTouch".

Thank you again for your help resolving this issue.

Thank you,

John Caspary
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39967647
I did test it and it works, but only for the current folder :)
I forgot to add the "-recurse" parameter.

The working solution would be:
gci "X:\your\path" -recurse | % {$_.LastWriteTime = $_.LastWriteTime.addHours(-1)}

Open in new window


Don't know how well this scales on thousands of files, though.

Best of luck!
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question