Skip to main content
 首页 » 编程设计

powershell之批量文件重命名之PowerShell

2024年12月31日15zhenyulu

很难说出这里问的是什么。这个问题是模棱两可的、含糊的、不完整的、过于宽泛或修辞的,不能以其目前的形式得到合理的回答。如需帮助澄清此问题以便可以重新打开,visit the help center .




10 年前关闭。




我在这个格式的文件夹中有很多文件

constant_blah_blah_blah.png 

如何用空格替换下划线并使用 PowerShell 从中删除 constant_?

提前致谢。

请您参考如下方法:

你可以试试这个

Get-childItem constant* | % {rename-item $_.name ($_.name -replace '_',' ')} 
Get-childItem constant* | % {rename-item $_.name ($_.name -replace 'constant ','')}