本帖最后由 pcl_test 于 2017-1-9 08:33 编辑
- //&cls&dir /a-d/b *.jpg *.jpeg 2>nul|cscript -nologo -e:jscript "%~f0"&pause&exit
-
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- var img = new ActiveXObject('WIA.ImageFile');
- while(!WSH.StdIn.AtEndOfStream){
- var f = fso.GetFile(WSH.StdIn.ReadLine());
- img.LoadFile(f);
- WSH.Echo(fso.GetFileName(f)+' '+
- (img.Width/img.HorizontalResolution*2.54).toFixed(1)+'x'+
- (img.Height/img.VerticalResolution*2.54).toFixed(1));
- }
复制代码
- @echo off
- powershell ^
- [void][Reflection.Assembly]::LoadWithPartialName('System.Drawing');^
- ls *.jpg,*.jpeg^|%%{^
- $img=[System.Drawing.Image]::FromFile($_.fullname);^
- $_.Name+' '+^
- ($img.Width/$img.HorizontalResolution*2.54).ToString('#0.0')+^
- 'x'+($img.Height/$img.VerticalResolution*2.54).ToString('#0.0');^
- }
- pause
复制代码
|