Mit
(Fresh Scripter)
2004-03-15 01:54 PM
Ways to get the date last modified/accessed

Is it possible, via KiX, to find the date that a file was last modified or accessed? I'ld like to create a script that will run through a directory structure and move all the "offending" files, along with their corresponding directory structure(!!), onto an area of the network that can be archived. Does anyone have a script that does this, or know of the calls that I can use to check the timestamps ?


TIA,
Tim.


Richard H.Administrator
(KiX Supporter)
2004-03-15 02:14 PM
Re: Ways to get the date last modified/accessed

The KiXtart built-in GetFileTime() will return the last modified time for closed files.

If you need the last accessed time, search the forums for information on the "file system object" (fso) which is an automation object that can provide more details.


Chris S.
(MM club member)
2004-03-15 02:18 PM
Re: Ways to get the date last modified/accessed

There is a function already built just for you...

See fnGetFileProp() - Uses FSO to retrieve file properties for files and it's cousin, fnGetFolderProp() - Uses FSO to retrieve folder properties for folders.


Sealeopard
(KiX Master)
2004-03-15 07:47 PM
Re: Ways to get the date last modified/accessed

See also the CleanDirectory() UDF in the UDF Forum.

NTDOCAdministrator
(KiX Master)
2004-03-16 03:32 AM
Re: Ways to get the date last modified/accessed

Using the Robocopy.exe: Robust File Copy Utility

Windows Server 2003 Resource Kit Tools
http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en


This is a free utility from Microsoft that will do exactly what you're wanting to do.

Robocopy "\\server1\sharename\folder1\folder2" "\\server1\sharename\folder3" *.avi /COPY:DAT /XO /R:10 /MAXAGE:30

This is just a sample of running it. Read the documentation that comes with it. A very useful utility with many new enhancements in this version.

It even supports only logging what it would do without actually doing anything till you tell it to.