简体   繁体   English

批处理脚本可将文件从scource移到目标文件夹,以保存30天以上的文件

[英]Batch script to move file from scource to destination folder for files older than 30 day

i want to create the batch script which could copy the 30 days older files from one folder to another. 我想创建可以将30天以前的文件从一个文件夹复制到另一个文件夹的批处理脚本。 And also deletes the 30 days old files from the source folder after copying to the destination folder 复制到目标文件夹后,还会从源文件夹中删除30天的旧文件

forfiles /p "c:\sourceFolder" /S /D -30  /C "cmd /c robocopy "C:\DestinationFolder"  "C:\sourceFolder" /mir @file : date>=30 days=nul"

Nothing has happened, not even error message is displayed 什么也没发生,甚至没有错误信息显示

robocopy sourceFolder targetFolder * /s /mov /minage:30 /l

如果列表正确,请从命令中删除/ l(仅列表)以进行移动

This robocopy only moves a few files and deleted my rar packages? 该robocopy仅移动了几个文件并删除了我的rar包? not working at all as I would like to. 根本不像我想要的那样工作。 I just want it to work as user3302083 wants. 我只希望它能按照user3302083的要求工作。 Just move folder that is 2 days old no other changes. 只需移动2天的文件夹就可以了。 Now I tried and it moved just a few files and deleted. 现在我尝试了一下,它只移动了几个文件并删除了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 批处理文件将超过30分钟的文件从一个文件夹复制到另一个文件夹 - batch file to copy files older than 30 minutes from one folder to another 用于将超过 30 天且具有特定扩展名的文件移动到另一个文件夹的 Windows 脚本 - Windows Script to move files older than 30 days with a specific extension to another folder 批处理脚本以检查子目录中的现有文件是否早于一天 - Batch Script to check if existing files inside subdirectories older than a day 批处理文件将超过1年的文件移动到另一个文件夹 - Batch file to move file older than 1 year to another folder 用于将文件从一台服务器移动到另一台服务器超过 45 天的批处理脚本 - batch script to move files from one server to another older than 45 days Windows批处理文件:使用UnixUtils find命令将X分钟之前的文件移动到其他目录 - Windows batch file: move files older than X minutes to a different directory using UnixUtils find command 批处理文件以递归方式删除超过N天的文件夹中的文件 - Batch file to recursively delete files in a folder older than N number of days 如何创建一个批处理脚本来删除早于 X 的文件而不是在根文件夹中删除并排除某些子文件夹? - How to create a batch script that deletes files older than X and not delete at the root folder and exclude certain subfolders? 在批处理脚本中按日期将文件移动到文件夹 - Move files to folder by date in a batch script PowerShell:从上次修改日期起,脚本将不计算30个以上的文件 - PowerShell: Script won't count files older than 30 from last modified date
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM