I am trying to create a batch-file which date stamps text files monthly.
I tried the following code, but this says file not found
, 0 files copied
.
set FileDate=%date:/=%
set FileDateYYYY=%FileDate:~0,4%
set FileDateMM=%FileDate:~4,2%
set /a FileDateMM=%FileDateMM%
if %FileDateMM% EQU 0 ( SET FileDateMM=12
SET /a FileDateYYYY=%FileDateYYYY%-1)
set FileDateOut=%FileDateYYYY%_%FileDateMM%
xcopy "L:\Capital Management\SAM Market Risk\OB lapses and surrenders\RawData\OB_PERSISTENCY.txt" "L:\Capital Management\SAM Market Risk\OB lapses and surrenders\RawData\%FileDate%\" /C /D /Y /I
File not found - OB_PERSISTENCY.txt
0 File(s) copied
Does anyone know why that is?
If I replace the name of the file OB_PERSISTENCY
with *
, it works, but I need it to work with the filename.