本帖最后由 pcl_test 于 2015-3-27 17:56 编辑
回复 2# 228630386 - 1>1/* :
- @echo off & setlocal enabledelayedexpansion
- set n=1
- for /f "delims=" %%a in ('dir /a-d /b /s *.jpg ^| cscript -nologo -e:jscript "%~0"') do (
- if !n! == 1 (set name=%%a & >"!name!.txt" echo,%%a) else (if not defined %%a set %%a=Def & >>"!name!.txt" echo,%%a)
- set /a n+=1
- )
- exit
- */
- var filelist = WScript.StdIn.ReadAll().split(/\r?\n/)
- var fso = new ActiveXObject('Scripting.FileSystemObject')
- var shell = new ActiveXObject('Shell.Application')
- var FLAG=0,NOFLAG=0
- var s=""
- for(var i in filelist){
- var fullpath = fso.GetFile(filelist[i]).Path
- var namespace = shell.Namespace(fullpath.replace(/[^\\]*$/,''))
- var parsename = namespace.ParseName(fullpath.replace(/.*\\/,''))
- var value = namespace.GetDetailsOf(parsename,namespace.GetDetailsOf('',18)==='标记'?18:5)
- s+=value+"\n"
- if(/\S/.test(value)){FLAG++}else{NOFLAG++}
- }
- WSH.Echo('共有'+(FLAG+NOFLAG)+'张JPG图片,其中'+FLAG+'张有标记,'+NOFLAG+'张无标记\n'+'标记内容包括:\n'+s)
复制代码
|