来一个系统原生的办法- 1>1/* :
- @echo off
- for /f "delims=" %%a in ('dir /a-d /b /s *.jpg ^| cscript -nologo -e:jscript "%~0"') do (
- echo %%a>"%%a.txt"
- )
- pause & exit /b
- */
-
- 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
-
- 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)
- if(/\S/.test(value)){FLAG++}else{NOFLAG++}
- }
-
- WSH.Echo('该目录下共有'+(FLAG+NOFLAG)+'张JPG图片,其中'+FLAG+'张有标记,'+NOFLAG+'张无标记')
复制代码
|