파일 확장자를 한꺼번에 모두 변경하기


.txt 파일을 .docx로 한꺼번에 변경하는 방법을 알아보자.

1) Get-ChildItem *.txt | Rename-Item -NewName {“$($_.BaseName).docx”} (선호됨)
또는  Get-ChildItem *.txt | Rename-Item -NewName { $_.name -Replace ‘\.txt’,’.docx’ } 

2) Get-ChildItem *.txt | foreach {rename-item -path $_ -newname “$($_.basename).docx”} (이전 방식)

참고: http://goo.gl/CZkhl

Leave a comment