如果我播放此批处理文件,它会向我发送如下错误消息, "系统无法找到指定的文件"
我搜索了很多,但我不知道......
我已经看过这篇文章,但它没有用。
System cannot find the path specified
echo off
echo **** TEST BACK UP BATCH FILE STARTS ****
setlocal enabledelayedexpansion
:LOOP
FOR %%f in (C:\Web\FTP\A\*.txt) do (
xcopy /Y %%f "C:\Web\FTP\A\B\"
SET "file=%%~nf"
SET "mydate=!date:~10,4!!date:~7,2!!date:~4,2!"
SET "mytime=!time:~0,2!!time:~3,2!!time:~6,2!"
ren "C:\Web\FTP\A\B\%file%.txt" "!file!_!mydate!!mytime!.txt"
move /Y "C:\Web\FTP\A\!file!.txt" "C:\Web\FTP\A\C\in\"
)
timeout /t 15
goto LOOP
答案 0 :(得分:0)
以上是评论中建议的所有更改。
echo off
setlocal enabledelayedexpansion
echo **** TEST BACK UP BATCH FILE STARTS ****
:LOOP
FOR %%G in (C:\Web\FTP\A\*.txt) do (
SET "mydate=%date:~10,4%%date:~7,2%%date:~4,2%"
SET "mytime=%time:~0,2%%time:~3,2%%time:~6,2%"
xcopy /Y "%%~G" "C:\Web\FTP\A\B\%%~nG_!mydate!!mytime!.txt"
move /Y "%%~G" "C:\Web\FTP\A\C\in\"
)
timeout /t 15
goto LOOP