用于移动文件的bat文件 [英] Bat file for moving files

查看:249
本文介绍了用于移动文件的bat文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个 bat 文件,将文件从一个位置移动到一个备份文件夹。条件是我需要移动父目录中的所有超过30天的文件夹。文件夹名称是文件夹的创建日期。

I want to create one bat file that will move files from one location to one backup folder. Condition is I need to move all folders which are older than 30 days inside parent directory. Name of folder is creation date of folder.

例如:
2012年10月17日的所有文件都将存在于名为10172012的文件夹中。源文件夹是:

For example: All files of 17 October 2012 would be there inside folder named 10172012.Source folders are:

C:\Data\DataIn\Processed\10172012

C:\Data\DataIn\Processed\09172012

C:\Data\DataIn\Processed\08172012

所以今天bat文件应该将文件夹09172012,08172012移动到目标备份文件夹:

So on today bat file should move folders "09172012", "08172012" to destination backup folder:

D:\Backup\Processed\


推荐答案

使用shell脚本去做。最后我使用shell脚本实现。

Using shell scripting it was easier to do. Finally I implemented this using shell scripting.

这篇关于用于移动文件的bat文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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