Hi,
I'm trying to copy the latest .dsx files from source H:\Data\Dir\datastage\ to H:\Data\Dir\Current\. I tried using the below script and I'm getting an warning message
The system cannot find the file specified.
I know below script will try to copy all the .dsx files but I need to copy only the latest files
@echo off
cd\
set filepath=H:\Data\Dir
FOR /F "TOKENS=*" %%G IN ('DIR/B "%filepath%\datastage\*.dsx"') DO
copy %filepath%\datastage\*.%%f "%filepath%\Current"
Thanks,
Raju
copy latest files from source to target directory
Moderator: DosItHelp
Re: copy latest files from source to target directory
somu_june wrote:I'm trying to copy the latest .dsx files from source H:\Data\Dir\datastage\ to H:\Data\Dir\Current\.
I know below script will try to copy all the .dsx files but I need to copy only the latest files
How many of the latest files? How many files are there in total?