本帖最后由 pcl_test 于 2019-2-27 14:15 编辑
- /*&cls
- @echo off
- set "文本=G:\人员信息\员工入职\copy.txt"
- set "源目录=Z:"
- set "新目录=G:\人员信息\员工入职\copy"
- if not exist "%新目录%" md "%新目录%"
- for /f "tokens=1* delims=|" %%a in ('dir /a-d/b/s "%源目录%\*.jpg"^|cscript -nologo -e:jscript "%~f0" "%文本%"') do (
- if not exist "%新目录%\%%~nxa" (
- echo;"%%a" --^> "%新目录%\%%~nxa"
- copy /y "%%a" "%新目录%\%%~nxa"
- )
- )
- pause&exit
- */
-
- var fso=new ActiveXObject('Scripting.FileSystemObject');
-
- var ftxt=fso.OpenTextFile(WSH.Arguments(0), 1);
- var keywords=ftxt.ReadAll().replace(/^\s*|\s*$/,'').split(/\r\n/);
- ftxt.Close();
-
- while(!WSH.StdIn.AtEndOfStream){
- var file=WSH.StdIn.ReadLine();
- var fname=fso.GetFile(file).Name;
- for(var i=0; i<keywords.length; i++){
- if(fname.toLowerCase().indexOf(keywords[i].toLowerCase()) > -1){
- WSH.echo(file+'|'+keywords[i]);
- }
- }
- }
复制代码
|