Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 8889

Writing a batch script to copy files based on date

$
0
0

I have a folder on a local PC that updates files through Dropbox. I have created a batch script that runs through a scheduler each day.

So far it checks to see if a folder is empty (C:\TheGlenFTP\sendho) before running some xcopy commands. I would like to add a condition to this script - that it also only runs the xcopy commands if the fileC:\Users\user\Dropbox\Combined\orderhea.dat is timestamped with today’s date.

Can any of you help with this?

This is the batch script so far.

@Echo offSetlocalSet _folder="C:\TheGlenFTP\sendho"For /F %%A in ('dir /b /a %_folder%') Do (    Echo The folder is NOT empty    goto :ok)xcopy C:\TheGlenFTP\combined\*.* c:\Holdsworth\Data\ /y /cxcopy C:\Holdsworth\Programs\xmit.ok C:\Holdsworth\Data\:ok

Viewing all articles
Browse latest Browse all 8889

Trending Articles