Command line - File access date

V

VDF

I would like to find all files which have not been touched for x days using
a command line statement recursing the output to a text file.

Perhaps somebody can tell me whether it is possible to delete all files not
touched for x days using a command line statement.

Regards

VDF
 
D

Dave Patrick

Use the DateLastAccessed property of the FileSystemObject in VBScript

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


:
|I would like to find all files which have not been touched for x days using
| a command line statement recursing the output to a text file.
|
| Perhaps somebody can tell me whether it is possible to delete all files
not
| touched for x days using a command line statement.
|
| Regards
|
| VDF
|
|
 
N

Nimit Mehta

You can make the VB file and run it from command prompt.
OR Try this.

@echo off
::
:: delete *.tmp files older than 2 days by BiTByte
::

::--------------------------------------------------
:: set date1 environment to date before 2 days
datetime @set DATE1=!Y!m!d!-d2 > date1.bat
call date1.bat

::--------------------------------------------------
:: give LSFDT the parameters to write all
:: older 2 days tmp files into dellist.txt
::
lsfdt -m lt -d %DATE1% *.tmp > dellist.txt

::--------------------------------------------------
:: delete the files stored in dellist.txt
::
delflist dellist.txt

OR TRY this small utility

http://www.jsiinc.com/SUBA/tip0200/rh0274.htm

Do testing with some dummy folder before you use above
script as its a loose description.
Let me know if this helped.
-Nimit
-----Original Message-----
Thanks Dave,

but I have to do it from the command prompt.

VDF

Use the DateLastAccessed property of the FileSystemObject in VBScript

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


:
|I would like to find all files which have not been
touched for x days
using
| a command line statement recursing the output to a text file.
|
| Perhaps somebody can tell me whether it is possible to delete all files
not
| touched for x days using a command line statement.
|
| Regards
|
| VDF
|
|


.
 
T

Torgeir Bakken \(MVP\)

VDF said:
I would like to find all files which have not been touched for x days using
a command line statement recursing the output to a text file.

Perhaps somebody can tell me whether it is possible to delete all files not
touched for x days using a command line statement.
Hi

In the article below there is a WSH script (vbscript) by Michael Harris
that deletes files x days old in a specific folder (and optionally all
subfolders).

Newsgroups: microsoft.public.scripting.wsh
Date: 2002-10-07 08:12:33 PST
http://groups.google.com/[email protected]


You can run it from a command prompt like this:

C:\>cscript.exe "path to .vbs file here"


WSH 5.6 documentation (local help file) can be downloaded from
here if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top