I am trying to get all the newest file from subdirectories into one network directory with a command without getting the subdirectory structures. They are the SQL Server log files with extension of *.trn
. I have the following but it doesn't work.
Trying to get only the newest *.trn
files from ...........Backup and it's subdirectories.
for /R E:\SQLSERVER\PRODINSTANCE1\Backup %%f in (*.trn) do xcopy %%f "\\198.152.71.14\NetBackups$\MSSQL\Logs" /B /O:D /d /Y