JS- @if (0) == (0) echo off
- dir /b /a-d *.jpg| cscript -nologo -E:JScript %0
- pause
- exit
- @end
- var img=new ActiveXObject("WIA.ImageFile"),
- fso = new ActiveXObject("Scripting.FileSystemObject");
- while(!WScript.StdIn.AtEndOfStream) {
- var file = WScript.StdIn.ReadLine();
- var f = fso.GetFileName(file);
- try{
- img.LoadFile(file);
- var Xdpi = Math.ceil( img.HorizontalResolution );
- if (Xdpi == 200) WSH.Echo(file);
- } catch(e) {};
- }
复制代码 powershell- <# :
- @echo off
- powershell -noprofile -NoLogo "iex (${%~f0} | out-string)"
- pause
- exit
- #>
- $extlist = @('.png','.jpg')
- Add-Type -Assembly System.Drawing
- foreach ($file in dir -path $pwd.Path|? { $extlist -eq $_.Extension }|?{!$_.PsIsContainer}) {
- try
- {
- $img = [Drawing.Image]::FromFile( $file.fullname)
- $dpiX = $img.HorizontalResolution
- if ($dpiX -eq 200 ) {" $file.fullname $dpiX"}
- $img.Dispose()
- } catch{}
- }
复制代码
|