How can I move/copy a file from D:\WindowsImageBackup\ to D:\Included\ if it’s a Sunday or delete D:\Included\ if it’s any other day?
The scenario is: An automatic backup to a remote server runs once a day. I want a certain file to be backed up only once a week, on a Sunday (it’s the Windows image backup). I have excluded the folder where the file lives (D:\WindowsImageBackup).
You can do it pretty easily:
Note that this works only if your system language is English, as it does a literal comparison of the day part of
Dateagainst the valueSun, and of course isn’t localized.Also, see my comment to your question about this perhaps being better for a scheduled task (as errors would stop it and write to the Event Log).