Grab our RSS feeds Follow us on Twitter Join our Facebook Group Connect with us on LinkedIn
myITforum.com, Powered by You.
you are not logged in

Articles

Newslinks

Links

Downloads

Site Services

Community Forums

Discussion Lists

Article Search

Newsletter

Web Blogs

FAQs

Live Support

myITforum TV

Take a Poll

Monthly Drawing

myITforum Network

User Group Directory

Our Partners

About Us

Register

Login

BRONZE PARTNER:

BRONZE PARTNER:



Industry News:




  Home : Articles : Windows PowerShell print | email | | Forums |   print | email | | Blogs |   print | email | | Wiki |   print | email | | FAQs |   print | email | Article Search  
Powershell script to change the Last Modified Timestamp for all the files in a folder


Bookmark and Share

By: Ying Li
Posted On: 4/4/2007

Here is a very cool script and you can change the last modified timestamp for all the files in a folder:

This article was Previously posted on Ying Li's Blog

$Now= Get-Date
$TargetFolder = Get-ChildItem "C:\MyWorkPlace"
foreach($file in $Targetfolder)
{
$file.LastWriteTime = $Now
$Now = $now.Addminutes(5)
}
$TargetFolder

I can choose whatever the time I want and just change to $now = Get-Date "3/21/2007 2:00 PM ". This will make me looks busy in front of my boss if he cares. Or I could help some VIP users (of course, they need to buy me lunch first!)



  myITforum.com ©2010 | Legal | Privacy