本帖最后由 pcl_test 于 2017-3-24 21:30 编辑
- 1>1/* :
- @echo off
- ::如果包括子文件夹里的图片,则改为dir /a-d /b /s *.jpg
- for /f "delims=" %%a in ('dir /a-d /b *.jpg 2^>nul^| cscript -nologo -e:jscript "%~f0"') do echo;%%a&set "def=%%a"
- if defined def (pause) else echo;Not Found&ping /n 2 0 >nul
- exit /b
- */
- try{var files = WSH.StdIn.ReadAll().split(/\r?\n/)}catch(e){WSH.quit()}
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var shell = new ActiveXObject("Shell.Application");
- var objFolder = shell.NameSpace(0);
- for(var i=0; i<300; i++) {
- if(/^水平分[辨辩]率$/.test(objFolder.GetDetailsOf(null, i))) {
- var x = i;
- }else if(/^垂直分[辨辩]率$/.test(objFolder.GetDetailsOf(null, i))) {
- var y = i;
- }
- }
- for(var f in files){
- var fpath = fso.GetFile(files[f]).Path
- var objFolder = shell.Namespace(fpath.replace(/[^\\]*$/,''));
- var objItem = objFolder.ParseName(fpath.replace(/.*\\/,''));
- var Xdpi = objFolder.GetDetailsOf(objItem, x).replace(/\D/g,'');
- var Ydpi = objFolder.GetDetailsOf(objItem, y).replace(/\D/g,'');
- if(Xdpi!=254 || Ydpi!=254)WSH.Echo(files[f]+' X:'+Xdpi+',Y:'+Ydpi);
- }
复制代码
|