如何使用dos命令基于日期范围基于日期作为批处理文件将文件从文件夹移动到另一个文件夹? [英] How to move files from a folder to another based on a date as a batch file based on a date span using dos command?

查看:256
本文介绍了如何使用dos命令基于日期范围基于日期作为批处理文件将文件从文件夹移动到另一个文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想基于使用Dos命令的日期范围将文件从文件夹移动到另一个文件夹作为批处理文件。将指定日期和日期,并且基于它,文件必须相应地移动。必须动态创建子文件夹,并且根据日期条件的文件必须在目标文件夹中移动。



我尝试过:



我可以根据修改日期使用以下命令将整个文件夹另外指定给另一个文件夹。

I want to move files from a folder to another folder as a batch file based on a date span using Dos command.There will be a from date and to date specified and based on it files must move accordingly. The sub folders must be created dynamically and files according to the date condition must move with in the destination folde .

What I have tried:

I am able to entire folder as such to another specified based on modified date with below command.

forfiles /P "E:\Alex\FTS_DOS\FileStore\REP" /M *.DMP /D +0 /C "cmd /c copy @path E:\Alex\FTS_DOS\Dest_FileStore\REP"





但我需要根据指定的日期移动文件,并动态创建子文件夹。



But I need the move the files based on a date specified and create subfolders if any dynamically.

推荐答案

首先要看看如何使用文件和日期 - 研究时间...这批处理文件获取文件日期 - Google搜索 [ ^ ]有很多解决方案。



这个问题突出: windows - 如何从文件中获取日期一个bat文件? - Stack Overflow [ ^ ]并在该页面的底部是这样的:删除早于以下文件 - Windows CMD - SS64.com [ ^ ]



现在你有一个进行日期测试以完成批处理文件的方法。
First thing is to look at how to work with files and dates - research time... This batch file get file date - Google Search[^] has a number of solutions.

This one sticks out: windows - How to get the date from a file in a bat file? - Stack Overflow[^] and down the bottom of that page is this: Delete files older than - Windows CMD - SS64.com[^]

Now you have a method to do the date test to complete your batch file.


这篇关于如何使用dos命令基于日期范围基于日期作为批处理文件将文件从文件夹移动到另一个文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆