Jump to content
Sign in to follow this  

Copying a file with a date minus 1 day

Recommended Posts


Hello, I'm trying to write a littel sript that automaticly copies files with a certain date from a folder to another. Thats the easy part:

FileCopy ("N:\NAS\output\001\001_"& @MDAY & "_" & @MON & "_" & @YEAR & "_02_30_00_02_59_59.avi" "J:\2burn")

Now I need the same line but with the date of the day before.... current date minus 1.

Could someone help?


Share this post

Link to post
Share on other sites

Welcome to the forums.

Look at the _Date functions- specifically _DateAdd().

This should get you started:

#include <Date.au3>
$sNewDate = _DateAdd('d', -1, _NowCalcDate())
MsgBox(4096, "", "Today - 1 day: " & $sNewDate)



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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.