delete file on particular date

View: New views
3 Messages — Rating Filter:   Alert me  

delete file on particular date

by mercykamal :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All
 
i want to delete a file on particular date please give me the code
 
 


      Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

[Non-text portions of this message have been removed]


Re: delete file on particular date

by foxidrive-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 17 Feb 2009 18:53:38 +0530 (IST), mercykamal
<kamal_mercy@...> wrote:

>Hi All

>i want to delete a file on particular date please give me the code

if "%date%"=="Mon 21/02/2009" del "file.txt"

Check the format of your %date% variable to adjust the date as it is
dependant on your locale.


Re: delete file on particular date using a script

by PatrickMc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

mercykamal wrote:
i want to delete a file on particular date please give me the code
If you mean delete files that were created/modified/accessed on a particular date/time, then following script will work.


# script delete.txt
# Get a list of files that were created on a particular date.
var str list ; lf -rn "*" "some folder" ( ($fctime < "20090101130000") AND ($fctime > "20090101120000") > $list
# Delete files one by one
while ($list <> "")
do
    var str file ; lex "1" $list > $file
    system delete ("\""+$file+"\"")
done


Script is in biterscripting ( http://www.biterscripting.com ) . The above script will delete files created between Jan 1, 2009 12:00 noon, and 1:00 pm. Use $fmtime for modification time, and $fatime for access time.

Patrick