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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last accessed date

Status
Not open for further replies.

jgodfrey71

IS-IT--Management
Feb 4, 2004
18
GB
We have around 120GB worth of documents and spreadsheets on one of our corporate file servers, though I suspect that around a third of these files are wasting space as they've never been opened by any member of staff for years. What I need is to be able to proof this so I can archive off all the stuff that never gets looked at.
It seems that I only need to browse a directory in order for the "date accessed" field in Windows Explorer to list the current date next to every file. Also, some files list the current date simply because our backup software backed them up during the current day. These things are not overly helpful. Does anyone therefore know of a utility that specifically tells you when a file was last opened by it's associated application ?
 
Opened no, but with vbscript you can check to see when a file was last modified using the FileSystemObject DateLastModified property.

Code:
Path = "C:\FolderNameToScan"

Dim fso 
Dim oFolder
Dim oFile
Set fso = createobject("Scripting.FileSystemObject")
Set oFolder = fso.GetFolder(Path)
  
  For Each oFile In oFolder.files
   	 Report = Report & oFile.Name & vbTab & oFile.DateLastModified & vbCrlf
  Next
  
  
Set ts = fso.CreateTextFile ("C:\FileLastmdifiedReport.txt", ForWriting)
ts.write Report

MsgBox "Done"

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top