Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Modified

Status
Not open for further replies.

tar565

Programmer
Jan 24, 2005
39
IE
I have copied a number of .msg files into a new folder in a script. Is there a way in which I can limit the files copied by the Windows 'Date modified' value/date.

Lets say I only want to copy the .msg files with date modified > last 7 days into the folder.

 
You'll want to check the files for their last Modification time.

Code:
if (-M $file > 1) #file hasn't been modified in less than a day
{
    #move file
}
else
{
    #do something else
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top