I just want to know if this is possible with a bath file.
I have 12 txt files that I want to copy (This is working) renaming them in new folder (this is working)
But not all of them change every day, so how can I only let the files that I change today, be copied to new folder, and
the others that have not changed and have yesterday date. not copied to folder.
Here are some of the code
Code: Select all
@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" rem & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
CD "D:\Users\hbezuidenhout\Documents\WindowsGP\Restore" 2>nul
echo copying file
copy "D:\Users\hbezuidenhout\Documents\Windows GP Restore.txt" "D:\Users\hbezuidenhout\Documents\WindowsGP\Restore\Windows GP Restore %DD% %MM% %YYYY%.txt" >nul
echo done
CD "D:\Users\hbezuidenhout\Documents\WindowsGP\Clients" 2>nul
echo copying file
copy "D:\Users\hbezuidenhout\Documents\Windows GP Clients.txt" "D:\Users\hbezuidenhout\Documents\WindowsGP\Clients\Windows GP Clients %DD% %MM% %YYYY%.txt" >nul
echo done
CD "D:\Users\hbezuidenhout\Documents\WindowsGP\Backup" 2>nul
echo copying file
copy "D:\Users\hbezuidenhout\Documents\Windows GP Backup.txt" "D:\Users\hbezuidenhout\Documents\WindowsGP\Backup\Windows GP Backup %DD% %MM% %YYYY%.txt" >nul
echo done
CD "D:\Users\hbezuidenhout\Documents\WindowsGP\Tapes" 2>nul
echo copying file
copy "D:\Users\hbezuidenhout\Documents\Windows GP Tapes.txt.txt" "D:\Users\hbezuidenhout\Documents\WindowsGP\Tapes\Windows GP Tapes %DD% %MM% %YYYY%.txt" >nul
echo done