Board logo

标题: [文件操作] 批处理怎样把超过一定时间的文件移动到其他地方? [打印本页]

作者: yooping    时间: 2014-7-17 12:03     标题: 批处理怎样把超过一定时间的文件移动到其他地方?

比如?  我D:\123下面生成的文件超过一个月的能不能自动移动到E:\123?
我在百度知道上
  1. @echo off&setlocal enabledelayedexpansion
  2. for /r d:\123 %%i in (*) do (
  3.    set str=%%~ti
  4.    set str=!str:~0,10!
  5.    if !str! lss 2014/06/30 move "%%i" e:\123
  6. )
  7. pause
复制代码
这样的无法移动文件夹.. 有没有办法能够移动里面的文件夹的?
作者: DAIC    时间: 2014-7-17 13:33

move命令不能跨分区移动文件夹
你可以先复制再删除




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2