当前位置: 动力学知识库 > 问答 > 编程问答 >

ssis - How to move subdirectories including files from directory

问题描述:

On a shared drive there is a directory "Q:\batch_Rxaoutput" inside that directory there are over a thousand directories for example "Q:\batch_Rxaoutput\SUNY" or "Q:\batch_Rxaoutput\PDFL". The subdirectory within "Q:\batch_Rxaoutput" contains only four letter codes where monthly reports are outputted by an SSIS package. Sometimes a report needs to re-ran due to errors so there are multiple reports created within one of the thousand or so output locations. My goal is to loop through each folder insided "Q:\batch_Rxaoutput" and move the folders, subfolders and files contain the same name.

For example in Q:\Batch_Rxaoutput\EEKY there is:

Q:\Batch_Rxaoutput\EEKY\Dec2014_20150108044150

Q:\Batch_Rxaoutput\EEKY\Dec2014_20150114090454

Q:\Batch_Rxaoutput\EEKY\Dec2014_20150115094531

Q:\Batch_Rxaoutput\EEKY\Feb2015_20150302122307

Q:\Batch_Rxaoutput\EEKY\Jan2015_20150202214348

Q:\Batch_Rxaoutput\EEKY\Jan2015_20150214223734

I want to to move only the no current folders,subfolders and files.

the monthly folder names are Month.year_year.month.hours(military).hours.seconds.milliseconds

So basically if there are multiple folder names Feb2015_* or Jan2015* move the ones that have the lowest numeric value after the underscore.

I would love to accomplish this from a .bat cmd if possible.

Please let me know if there is more info that would help!

分享给朋友:
您可能感兴趣的文章:
随机阅读: