重命名文件夹和Windows系统中的文件递归
我有以下文件夹结构:
Top Folder
-> SubFolder1
-> MyFolder_Latest
-> MyFile_Latest.txt
-> SubFolder2
-> MyFolder_Latest
-> MyFile_Latest.txt
-> SubFolder3
-> MyFolder_Latest
-> MyFile_Latest.txt
我希望更改上面给出的不同子文件夹中的文件夹和文件。所有文件夹和文件都具有相同的名称,我希望更改为以下名称:
Top Folder
-> SubFolder1
-> myfolder
-> myfile.txt
-> SubFolder2
-> myfolder
-> myfile.txt
-> SubFolder3
-> myfolder
-> myfile.txt
基本上在这里做两件事: a) 从所有文件和文件夹名称中删除 _Latest。 b) 将所有文件夹和文件的大小写更改为小写
有人知道如何在 Windows 中实现上述目标吗?我的系统不允许安装 UNIX,并且我无法将这些文件复制到 UNIX 系统,因为我们的网络当前不提供任何 UNIX 机器上的 SCP 或 FTP 权限:-(
另外,如果有人在 UNIX 中有合适的解决方案,我可以尝试将文件夹复制到 DVD 并尝试在 UNIX 机器上运行命令:-)
I have the following folder structure:
Top Folder
-> SubFolder1
-> MyFolder_Latest
-> MyFile_Latest.txt
-> SubFolder2
-> MyFolder_Latest
-> MyFile_Latest.txt
-> SubFolder3
-> MyFolder_Latest
-> MyFile_Latest.txt
I wish to change the folders and files in the different SubFolders, given above. All the folders and files have the same name, and I wish to change to the following:
Top Folder
-> SubFolder1
-> myfolder
-> myfile.txt
-> SubFolder2
-> myfolder
-> myfile.txt
-> SubFolder3
-> myfolder
-> myfile.txt
Basically doing two things here:
a) Removing the _Latest from all the file and folder names.
b) Chnaging the case of all the folders and files to lower case
Anybody has any idea on how to achieve the above in Windows? My system does not allow installation of UNIX and I cannot copy those files to a UNIX system, as our network currently does not provide SCP or FTP permissions on any of the UNIX boxes :-(
Also, if someone has a suitable solution in UNIX, I can try copying the folders to a DVD and trying to run the commands on a UNIX box :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显示的文件夹结构不需要递归。只需循环遍历结构第一层中的所有文件夹并适当地重命名它们即可。
请参阅
HELP FOR
并尝试在仔细测试后开始使用
,删除
ECHO
命令。The folder structure shown does not require recursivity. Just loop through all the folders in the first level of the structure and rename them appropriately.
See
HELP FOR
and try this to get you started
after careful testing, remove the
ECHO
command.