카테고리 없음2015. 5. 6. 18:58

파워셀을 이용하면 되고 스크립트는 다음과 같다.


아래 &match는 바꿀 문자열  &replacement는 변환할 문자열로 입력하되 하위에도 *slf* 라고 되어있는 부분은 직접 넣어줘야하는듯.


$match = "swtichstr" 

$replacement = "convertedstr"


$files = Get-ChildItem $(get-location) -filter *sif* -Recurse


$files |

    Sort-Object -Descending -Property { $_.FullName } |

    Rename-Item -newname { $_.name -replace $match, $replacement } -force




$files = Get-ChildItem $(get-location) -include *.* -Recurse 


foreach($file in $files) 

    ((Get-Content $file.fullname) -creplace $match, $replacement) | set-content $file.fullname 

}


read-host -prompt "Done! Press any key to close."

Posted by 억사마