我试了下,运行,会报以下错误,但是好像不影响改名。规则是对的。包括子目录都一次性改好了。- powershell "dir -rec|foreach{ren $_.fullname $($_.name -replace '[^0-9a-z\u4e00-\u9fff\-\.\s\w]')}"
复制代码 ren : 源路径和目标路径必须不同。
所在位置 行:1 字符: 18
+ ... rec|foreach{ren $_.fullname $($_.name -replace '[^0-9a-z\u4e00-\u9fff ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (H:\Sex2\Temp:String) [Rename-Item], IOException
+ FullyQualifiedErrorId : RenameItemIOError,Microsoft.PowerShell.Commands.RenameItemCommand |