(BAT批处理)求当前文件夹内图片批量修改正反旋转90度的批处理代码

不清楚你的实际文件/情况,仅以问题中的说明及猜测为据;以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI,跟要处理的文件放一起双击运行

<# :
cls&echo off&cd /d "%~dp0"
rem 对当前目录里的图片进行逆时针旋转90度
set #=Any questions&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
set "current=%cd%"
powershell -NoProfile -ExecutionPolicy bypass "Get-Content -literal '%~f0'|Out-String|Invoke-Expression"
echo;%#% +%$%%$%/%_% %z%
pause
exit
#>
$angle=-90;
$current=$env:current;
$output=$current+'\result';
$wif=New-Object -ComObject 'WIA.ImageFile';
$wip=New-Object -ComObject 'WIA.ImageProcess';
if(-not (test-path -literal $output)){[void][IO.Directory]::CreateDirectory($output);}
$files=@(dir -literal $current|?{(@('.jpg','jpeg','.bmp','.png') -contains $_.Extension) -and ($_ -is [System.IO.FileInfo])});
if($files.leng

你可能感兴趣的:(bat,BAT批处理,batch)