ImageMagick & powershell 批量转换图片
目录结构如下
..\
..\convert.exe
..\src
..\target
Powershell Code
set-ExecutionPolicy RemoteSigned $path=get-location $local=$path.Path $localSrc=$local+"\src" $localTarget=$local+"\target" $localConvert=$local+"\convert.exe" get-childitem $localSrc -Name | ForEach-Object{ invoke-expression ($localConvert + " " + $localSrc + "\" + $_ + " " + $localTarget + "\" + ($_ -replace "tga","png")) }
未着色代码
set-ExecutionPolicy RemoteSigned
$path=get-location
$local=$path.Path
$localSrc=$local+"\src"
$localTarget=$local+"\target"
$localConvert=$local+"\convert.exe"
get-childitem $localSrc -Name | ForEach-Object{ invoke-expression ($localConvert + " " + $localSrc + "\" + $_ + " " + $localTarget + "\" + ($_ -replace "tga","png")) }
-----------------------------------
http://www.cnblogs.com/rock_chen/