回复 4# panda951
1、路径不对
2、文件的修改日期不对
运行以下检测程序,把显示结果截图看看- @echo off
- echo %USERPROFILE%
- ver | find "5.1." >nul && set "Startpath=%USERPROFILE%\「开始」菜单\程序\启动"
- ver | find "6." >nul && set "Startpath=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
- echo %Startpath%
- if not exist "C:\Users\%USERNAME%\backup\" (echo NO) else (echo OK)
- if not exist "%USERPROFILE%\backup\" (echo NO) else (echo OK)
- echo %date:~,10%
- for /r "%USERPROFILE%\backup\" %%a in (*) do %%~ta
-
- for /r "%USERPROFILE%\backup\" %%a in (*) do (
- set "wrdate=%%~ta"
- setlocal enabledelayedexpansion
- set "wrdate=!wrdate:~,10!"
- if "!wrdate!" equ "!date:~,10!" (echo xcopy "%%a" "C:\backup\" /y)
- endlocal
- )
- pause
复制代码 回复 5# panda951
::和rem是什么意思?if "!wrdate!" equ "!date:~,10!" 又是什么意思? |