Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-03-13
3
Medium Priority
?
361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

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

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
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 antispam), the admini…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

705 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