简体   繁体   English

批处理文件以在现有文件夹中创建子文件夹结构

[英]batch file to create subfolder structure within existing folders

I want to create the following folder structure at work. 我想在工作中创建以下文件夹结构。 I have to add an 'archived emails' directory, sorted by year, then month within 50(ish) folders that are individual towns. 我必须添加一个“存档电子邮件”目录,按年份排序,然后在每个镇的50(ish)文件夹中按月排序。 Folder in bold already exists: 粗体文件夹已经存在:

  • Town

    • Archived emails 封存的电子邮件

      • YYYY YYYY

        • 01JanYYYY 1月1日

        • 02FebYYYY 02FebYYYY

        • 03MarYYYY 3月3日

etc etc

the preceding 01,02,03 in the months folder is so the months are sorted in explorer properly. 月份文件夹中的前面的01,02,03是这样,以便月份在浏览器中正确排序。 Could someone help me out with writing up the batch file please? 有人可以帮我写批处理文件吗? I'm not too good with the syntax. 我对语法不太满意。

Thanks 谢谢

For creating a folder simply use 要创建文件夹,只需使用

md "C:\[PATH-TO-TOWN]\Archived emails"

for example 例如

Here you have a nice resource for batch scripting. 在这里,您有一个不错的批处理脚本资源。 You can find there also a neat description of how to make a loop in batch scripts. 您还可以找到有关如何在批处理脚本中进行循环的简洁说明。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM