Windows10 Powershell批量更改后缀名

操作系统:Windows10 1809

使用工具:Powershell

命令

1 (dir '文件目录\*.原后缀名')|rename-item -newname { $_.name -replace '\.原后缀名','.要更改后缀名' } 

范例

1 (dir 'D:\My Documents\works\Downloads\powershell\*.txt')|rename-item -newname { $_.name -replace '\.txt','.log' } 

 

来自 <https://zhidao.baidu.com/question/384260033.html?qbl=relate_question_0&word=powershell%20%D0%DE%B8%C4%CE%C4%BC%FE%BA%F3%D7%BA>

 

posted @ 2019-05-28 10:18  墨柯  阅读(2655)  评论(0编辑  收藏  举报