本帖最后由 pcl_test 于 2017-8-21 19:19 编辑
- /*&cls
- @echo off
- ::如果包括子文件夹里的图片,则改为dir /a-d /b /s *.jpg
- dir /a-d /b *.jpg | cscript -nologo -e:jscript "%~f0"
- pause&exit /b
- */
-
- var files = WScript.StdIn.ReadAll().split(/\r?\n/);
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var shell = new ActiveXObject("Shell.Application");
- var objFolder = shell.NameSpace(0);
- var i = 0;
- while(1){if (objFolder.GetDetailsOf(null, i) == "尺寸"){break}else i++;}
- var str='';
- for(var f in files){
- var fd = fso.GetFile(files[f]).Path
- var objFolder = shell.Namespace(fd.replace(/[^\\]*$/,''));
- var objItem = objFolder.ParseName(fd.replace(/.*\\/,''));
- var size = objFolder.GetDetailsOf(objItem,i);
- str+=files[f]+size+'\r\n';
- }
- WSH.Echo(str);
复制代码
- @echo off
- powershell ^
- $wi=New-Object -com 'WIA.ImageFile';^
- dir . -inc *.jpg,*.jpeg,*.png^|%%{^
- $wi.LoadFile($_);^
- $_.Name+' '+$wi.Width+'x'+$wi.Height;^
- }
- pause
复制代码
|