在Jenkins上配置批处理删除远程共享目录7天以上的文件

net use * /del /yes
NET USE X: \\10.29.48.12\shares\Test password /user:DOMAIN1\account
 
set AutoPath=X:\
%AutoPath:~0,2% 
pushd %AutoPath%
cd /d %AutoPath%

rem delete reports generated 7 days ago
forfiles /p %AutoPath% /s /m *.* /d -7 /c "cmd /c del /f @path">nul 2>nul
ping 127.0.0.1 -n 15 > nul

for /f "tokens=*" %%a in ('dir /b /ad /s^|sort /r') do rd "%%a" 2>nul
ping 127.0.0.1 -n 15 > nul


exit 0

  

上一篇:对拍程序写法


下一篇:c++对拍程序写法(windows系统下)