本帖最后由 apang 于 2013-12-27 00:07 编辑
- @set @n=1 //&dir /b *.txt|cscript -nologo -e:jscript "%~0" &pause&exit /b
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var ar = new Array("曾孝琼","陈家江","关山月");
- while (!WScript.StdIn.AtEndOfstream) {
- var f = WScript.StdIn.ReadLine();
- var txt = fso.OpentextFile(f).ReadAll();
- var s = "";
- for (i=0; i<=ar.length; i++) {
- if (txt.indexOf(ar[i])>-1) { s += ar[i] + " " };
- };
- if (s != "") { WScript.Echo(s + f) };
- };
复制代码
|