Changing all files' extensions in a folder with one command on Windows

后端 未结 11 1838
南方客
南方客 2020-12-07 08:00

How can I use the Windows command line to change the extensions of thousands of files to *****.jpg?

11条回答
  •  一向
    一向 (楼主)
    2020-12-07 08:40

    I know this is so old, but i've landed on it , and the provided answers didn't works for me on powershell so after searching found this solution

    to do it in powershell

    Get-ChildItem -Path C:\Demo -Filter *.txt | Rename-Item -NewName {[System.IO.Path]::ChangeExtension($_.Name, ".old")}
    

    credit goes to http://powershell-guru.com/powershell-tip-108-bulk-rename-extensions-of-files/

提交回复
热议问题