我在 Windows 7 中运行了代码,它运行良好......当我在 Windows XP 中运行此代码时,我得到了 forfiles 无法识别。
call :moveOldFiles D:\coupon\Source\1 *.* %days% D:\coupon\Destination\3 >>D:\coupon\logs\log.txt
:moveOldFiles sourceDir extension minAgeInDays destinationDir
forfiles /p "%~f1" /m %2 /d -%3 -c "cmd /c move /y @path ""%~f4\"" && echo @path moved to "%~f4"""
exit /b