I have a file that is generated with the current date using the Month, Day and Year. Previously this file did not include a date and I used a script with the _%All% in a batch file to move the file to a different folder and this works fine.
I now need the correct syntax to use so that the script will take the file with the current date and continue to have the script move the file into a backup folder.
The following is the script that has been used successfully.
@echo off @For /F "tokens=1,2,3,4 delims=/ " %%A in ('Date /t') do @( Set DayW=%%A Set Day=%%B Set Month=%%C Set Year=%%D Set All=%%A%%B%%C%%D ) move \\crserverXX\Batch\ASCII\OCR1_CRM\OCR1.CSV \\crserverXX\Batch\ASCII\OCR_Backup\OCR1.CSV ren \\crserverXX\Batch\ASCII\OCR_Backup\OCR1.CSV OCR1_%All%.CSV move \\crserverXX\Batch\ASCII\OCR1_CRM\OCR1.CSV.bak \\crserverXX\Batch\ASCII\OCR_Backup\OCR1.CSV.bak ren \\crserverXX\Batch\ASCII\OCR_Backup\OCR1.CSV.bak OCR1_%All%.CSV.bak
The issue now is that the file generated each day will also include the date as in the following: OCR1081916.CSV.
What is the correct way to use the date variable so that it will move the OCR1 file regardless of the date?