jfif格式图片批量转换为png格式
<# :
cls&echo off&cd /d "%~dp0"&mode con lines=5000
path %SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%path%
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
#>
Add-Type -AssemblyName 'System.Drawing';
$current=($env:current).trimend('\');
$newfolder=$current+'\result';
if(-not (test-path -literal $newfolder)){[void][IO.Directory]::CreateDirectory($newfolder);}
$files=@(dir -literal $current|?{(@('.jfif') -contains $_.Extension) -and ($_ -is [System.IO.FileInfo])}|sort {$_.LastWriteTime});
for($i=0;$i -lt $files.length;$i++){
write-host ('[{0}]{1}' -f $files[$i].LastWriteTime.toString('yyyy-MM-dd HH:mm:ss'),$files[$i].FullName.Substring($current.length));
$newfile=$newfolder+'\'+($i+1)+'.png';
$img=New-Object System.Drawing.Bitmap($files[$i].FullName);
$img.Save($newfile,[System.Drawing.Imaging.ImageFormat]::Png);
$img.Dispose();
}
<# :
cls&echo off&cd /d "%~dp0"&mode con lines=5000
path %SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%path%
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
#>
Add-Type -AssemblyName 'System.Drawing';
$current=($env:current).trimend('\');
$newfolder=$current+'\result';
if(-not (test-path -literal $newfolder)){[void][IO.Directory]::CreateDirectory($newfolder);}
$files=@(dir -literal $current|?{(@('.jfif') -contains $_.Extension) -and ($_ -is [System.IO.FileInfo])}|sort {$_.LastWriteTime});
for($i=0;$i -lt $files.length;$i++){
write-host ('[{0}]{1}' -f $files[$i].LastWriteTime.toString('yyyy-MM-dd HH:mm:ss'),$files[$i].FullName.Substring($current.length));
$newfile=$newfolder+'\'+($i+1)+'.png';
$img=New-Object System.Drawing.Bitmap($files[$i].FullName);
$img.Save($newfile,[System.Drawing.Imaging.ImageFormat]::Png);
$img.Dispose();
}