robocopy | Microsoft Docs[
^]
There is no support for wildcards in the source directory. You'll need to use a
for
loop to issue a separate
robocopy
command for each matching folder.
FOR /D %G In ("\\networksourcepath\path\19*") DO robocopy %G \\networkdestinationpath\path\%~nG /E /MOVE /MT
(In a batch file, you'd need to double-up the %
characters.)
I can't see an easy way to copy folders based on their creation date in a batch file. You might need to use Powershell for that.
$MaxDate = Get-Date -Date "2019-01-01"
Get-ChildItem "\\networksourcepath\path" -Attributes Directory | Where-Object CreationTime -lt $MaxDate | ForEach-Object -Process {
$destination = "\\networkdestinationpath\path\$($_Item.Name)"
robocopy $_.FullName $destination /E /MOVE /MT
}