REM 设置本地文件夹路径 set LOCAL_FOLDER=C:\Path\To\Local\Folder
REM 获取当前日期 for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') doset"dt=%%I" set"YYYY=%dt:~0,4%" set"MM=%dt:~4,2%" set"DD=%dt:~6,2%"
REM 设置域文件夹路径 set DOMAIN_FOLDER=\\DomainController\Share\%YYYY%-%MM%-%DD%
REM 确保目标文件夹存在,如果不存在则创建它 if not exist "%DOMAIN_FOLDER%" mkdir "%DOMAIN_FOLDER%"
REM 复制文件到域文件夹 xcopy "%LOCAL_FOLDER%\*""%DOMAIN_FOLDER%\" /s /e /i /y