Jump to content
Sign in to follow this  
lyledg

Run a script based on Date

Recommended Posts

lyledg

Guys

I am trying to write a simple script that will delete a file on the last day of the month. I have had a look at the forums and not really seen anything that would help...

Any Ideas?

Share this post


Link to post
Share on other sites
CyberSlug

Should work if I didn't make a mistake:

$daysPerMonth = StringSplit("31,28,31,30,31,30,31,31,30,31,30,31", "")
If Mod(@YEAR,400)=0 Or (Mod(@YEAR,4)=0 And Mod(@YEAR,100)<>0) Then $daysPerMonth[2] = "32";leap year
If $daysPerMonth[@MON] = @MDAY Then MsgBox(4096,"Info","Last Day of month.... delete file....")

Otherwise, look at the JdeB's excellent collection of Date UDF's which are in the "C:\Program Files\AutoIt3\Include\Date.au3" file....


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites
Guest Guidosoft

And they didn't think to include me in their includes. :D

THAT SUX!!!

OH no. What's happening to me.

:idea::D:idiot::idea::lol::D:D;)

I AM EVIL!!!!

Share this post


Link to post
Share on other sites
Jos

And they didn't think to include me in their includes.  :idea:

<{POST_SNAPBACK}>

Did you ever bother to read the UDF post at all where you replied to ? :D

THAT SUX!!! 

OH no. What's happening to me.

:lmao:  :idea:  :idiot:  :wacko:  :lol:  :D  :D  :D

I AM EVIL!!!!

;) Wonder why you're not treated seriously ???

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
sykes

And they didn't think to include me in their includes.  :D

THAT SUX!!! 

OH no. What's happening to me.

:idea:  :D  :idiot:  :idea:  :lol:  :D  :D  ;)

I AM EVIL!!!!

<{POST_SNAPBACK}>

Didn't one of your includes delete someones registry recently?

We have enough youth. How about a fountain of SMART?

Share this post


Link to post
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
Sign in to follow this  

×