Rename file by replacing character and overwrite

后端 未结 2 1363
醉酒成梦
醉酒成梦 2021-01-20 02:08

On Windows XP, in a folder of files, I need to rename some files, replacing one character in the filename with another and overwriting any files that already have that name.

2条回答
  •  旧时难觅i
    2021-01-20 02:50

    You can try the Move-Item command instead, with the -Force parameter.

    Get-ChildItem . -include *.xml | Move-Item -Destination { $_.name.Replace("A","b")} -Force
    

提交回复
热议问题