from
C:\Users\DickSL\AppDAta\Roaming\Testbat\Testbati.txt
to
F:\Testbat\%filename%
Batch file
Code: Select all
@echo off
set "hr=%time:~0,2%-%time:~3,2%-%time:~6%"
echo %hr%
set "filename=%date%_%hr%_Testbati.txt"
echo %filename%
pause
copy c:\users\DickSL\AppData\Roaming\Testbat\testbati.txt f:\Testbat\"%filename%"
pause
"The system cannot find the path specified"
Testbati.txt is definitely in the directory specified in the copy command above.
The echo statement below the set command %filename% echoes the following
Sun 12/10/2017_ 6-02-41.94_Testbati.txt correctly.
Why am I getting the path not found?
Thanks in advance.