阅读背景:

[BAT] 以当前时间为名创建文件夹,将本地文件夹里的文件拷贝到远程共享目录..._yuxiaoyu.的博客

来源:互联网 
@echo off

set sourcePath=D:\DOAutomationTest\automation_do_ma_soapui\TestResult\PA
set targetPath=\szotwin2k801\AutomationReport\PA

set directoryName=%date:~6,-4%-%date:~0,2%-%date:~3,2%-%time::=-%
echo I will create a directory : +%directoryName%

if exist %targetPath%\%directoryName% (echo y|cacls %targetPath%\%directoryName% /p everyone:f >nul 2>nul &&rd /s /q %targetPath%\

%directoryName%) else echo directory doesn't exist,create it

md %targetPath%\%directoryName%
xcopy /d %sourcePath% %targetPath%\%directoryName%

rem delete reports generated 7 days ago
forfiles /p %targetPath% /s /m *.* /d -7 /c "cmd /c del /f @path">nul 2>nul
for /f "tokens=*" %%a in ('dir /b /ad /s^|sort /r') do rd "%%a" 2>nul

exit
@echo off

set sourcePath=D:\DOAutomat



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: