I would like a batch code to search threw 3 folders and to copy the newest file out of the 3 folders and to copy it to another location.
I have a working batch that looks for the newest file but only searches in one folder
Here it is:
for /f "tokens=*" %%a in ('dir /b /od 2^>NUL') do set lastmod=%%a
if "%lastmod%"=="" echo Could not locate files.&goto :eof
copy "%lastmod%" "%destDir%"
But i would like it to search in 3 folders and copy the newest file.
Any help will be greatly appreciated.