Jump to content

Delteing Files by date last accessed


Guest nate020605
 Share

Recommended Posts

Guest nate020605

I'm curious if there is a way to search a network directory such as a shardedrive and delete old files by date last accessed. i havnt found anything in AutoIt that would check the date last accessed, Simply put I need Advice on how to.

1. Write a script that will Search a Drive

2. Find out the date last accessed of all files

3. delete them if they exceed the specified length of time.

Thanks for all the help in advance

Link to comment
Share on other sites

Thanks herewasplato for the reply.

I still don't understand the usage of this script. Can I call the the udf and pass arguments to it like path and age, if so what is the syntax for that, or do I need to edit the script and hardcode the age and path of files I want to delete?

Link to comment
Share on other sites

  • Developers

Thanks herewasplato for the reply.

I still don't understand the usage of this script. Can I call the the udf and pass arguments to it like path and age, if so what is the syntax for that, or do I need to edit the script and hardcode the age and path of files I want to delete?

Please do not run this script if you dont understand what it does..

It was intended to get you a head start.

Deleting files is never a trivial thing to just grab somebodies script and "Try" it ...

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Please do not run this script if you dont understand what it does..

It was intended to get you a head start.

Deleting files in never a trivial thing to just grab somebodies script and "Try" it ...

I appreciate your concern. however it doesn't help me a whole lot. I was doing some research on udfs, and from what I understood they are code snippets that you can use in scripts by just including the .au3. So if I saved your script as delfiles.au3 and included it in another script, I could just call the function remove files and pass it parameters. Is that correct?

Link to comment
Share on other sites

  • Developers

I appreciate your concern. however it doesn't help me a whole lot. I was doing some research on udfs, and from what I understood they are code snippets that you can use in scripts by just including the .au3. So if I saved your script as delfiles.au3 and included it in another script, I could just call the function remove files and pass it parameters. Is that correct?

That is correct ... all I am saying is make sure you comment the filedelete() portion while testing ...

The UDF makes a logfile where you can check what it would have done ..

:)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Thanks herewasplato for the reply.

I still don't understand the usage of this script...

Neither do I :-)

I would have to study each line - but I have no need for this UDF at this time - so... that task will fall to you.

..and like JdeB said, you can "include" the file using the include file.

(or just copy/paste it to the bottom of your main script)

...enjoy...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...