本文介绍了批量创建文件,其中包含文件所在的文件夹的名称以及其他数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网络驱动器(本地映射),用于存储组织中每个用户的备份(超过2000个).树是这种形式:

  • 用户名0001 \存档
  • ...
  • 用户名0456 \ archive
  • ...
  • 用户名0789 \ archive
  • ...
  • 用户名2000 \ archive

我想从批处理脚本中,在用户的每个备份文件夹中创建一个名为"backup.conf"的文件,该文件包含两行:

[用户名] >> 第一行

ArchivePath = archive >> 第二行

[]] 之间具有真实的用户名.

您对可能导致这种情况的代码有任何想法吗?

我尝试了以下批处理脚本:

  cd mynetworkmappeddrive字母:(例如X :)为(*)中的/d %% a做(回显%% a> %% a \ backup.conf) 

如何在用户名之间添加第二行和 [] ?

谢谢您的帮助.

解决方案

我尝试了以下批处理脚本:

  cd mynetworkmappeddrive字母:(例如X :)为(*)中的/d %% a做(回显%% a> %% a \ backup.conf) 

如何在用户名之间添加第二行 ArchivePath = archive 并添加 [] ?

I have a network drive (mapped locally) where the backups of each user of my organisation are stored (more than 2000).The tree is in this form :

  • username0001\archive
  • ...
  • username0456\archive
  • ...
  • username0789\archive
  • ...
  • username2000\archive

I would like from a batch script, create a file called "backup.conf" in each backup folder of my users, which would contain 2 lines :

[username] >> 1st line

ArchivePath=archive >> 2nd line

With the real username between [  ].

Do you have any idea of code that could lead to this ?

I tried the following batch script :

cd mynetworkmappeddriveletter: (e.g. X:)
for /d %%a in (*) do (echo %%a > %%a\backup.conf)

How to add the second line and [ ] between the username ?

Thank you for your help.

解决方案

I tried the following batch script :

cd mynetworkmappeddriveletter: (e.g. X:)
for /d %%a in (*) do (echo %%a > %%a\backup.conf)

How to add the second line ArchivePath=archive and add [ ] between the username ?

这篇关于批量创建文件,其中包含文件所在的文件夹的名称以及其他数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 20:24