将所有文件重命名为小写,替换空格
在 Windows 命令提示符中,如何将所有文件重命名为小写并删除所有空格?
In a Windows command prompt, how can I rename all the files to lower case and remove all spaces?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
制作一个批处理文件
注意:在测试目录下运行,看看是否有预期的结果。我还没有测试过。
编辑:忘记说这只会删除空格。
Make a batch file
NOTE: Run under a test directory and see if you have the expected result. I have not tested it.
EDIT: Forgot to say this will only remove the spaces.
我使用此批处理文件将所有文件夹和子文件夹重命名为小写名称:
I used this batch file to rename all folders and subfolders to lowercase names:
要制作“小写”和“删除空格”的技巧......
在给定的解决方案中,在“dir”语句中,还使用“/l”
正如“Windows-RENAME”命令,如果您使用“相同”的文件名,它会提示从大写转换为小写。
结果总是: XPTO.TXT
为了“绕过”这个,我们使用短暂的技术:
将 old 移至 temp,然后 ->将 temp 移至 new
那么解决方案是:
To make the trick of "lowercase" and "remove spaces" ...
In the given solution, in the 'dir' statement, use also "/l"
As "Windows-RENAME" command, if you use the "same" filename, it will note convert from uppercase to lowercase.
The result will always be : XPTO.TXT
To 'bypass' this, we use the ephemeral technique:
move old to temp, then -> move temp to new
Then the solution would be: