zoukankan      html  css  js  c++  java
  • ScanFiles脚本

    Function ScanFolder(TF,WORD)
       Dim Fso,TFCount
       TFCount=0
       Set Fso = CreateObject("Scripting.FileSystemObject")
       Set FDS = Fso.GetFolder(TF)
       For Each FD in FDS.subFolders
     Call ScanFolder(FD,WORD)
           For Each F in FSO.GetFolder(FD).Files
     IF CheckFileExt(F.Path)=True then
      IF ScanWord(F.Path,WORD)=True Then Wscript.Echo F.Path
     End IF
     Next
       Next
    End Function

    Function ScanWord(pFile,WORD)
     IF Instr(ReadText(pFile),WORD) Then ScanWord=True:Exit Function
     ScanWord=False  
    End Function

    Function ReadText(pFile)
       Dim FSO,F
       Set FSO = CreateObject("Scripting.FileSystemObject")
       Set F = FSO.OpenTextFile(pFile,1,True)
       ReadText=F.ReadAll
    End Function

    Function CheckFileExt(Fname)
       Dim FileExtStr,FileExt
       FileExtStr=Right(Fname,Len(Fname)-InstrRev(Fname,".",-1,1)+1)
     CheckFileExt=False
       FileExt=".c|c.h"
       FileExt=Split(FileExt,"|")
       For I=0 to Ubound(FileExt)
     IF Instr(Fname,FileExt(I)) Then CheckFileExt=True:Exit Function
       Next
    End Function
    '====================Start===============================
    IF Wscript.Arguments.Count<2 Then
    Wscript.Echo "┌┄┄┄┄┄┐┌┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐"&vbCrlf
    Wscript.Echo "┆参数不对!┆┆ScanFolder.Vbs By Liou QQ:5172388 http://cnLiou.cn┆"&vbCrlf
    Wscript.Echo "└┄┄┄┄┄┘└┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘"&vbCrlf
    Wscript.Quit
    End IF
    ScanFolder Wscript.Arguments(0),WScript.Arguments(1)

  • 相关阅读:
    TFIDF
    奇异值分解(singular value decomposition,SVD)
    (转载)先验分布
    在博客中写公式的两种方法
    linux 下配置JDK JRE ECLIPSE TOMCAT
    tensor decomposition
    Form界面设置只读
    FORM LOV特性
    在Oracle Form中,如何实现自动编号(行号)的功能
    文件夹错误frm41097,frm41053
  • 原文地址:https://www.cnblogs.com/cnLiou/p/200548.html
Copyright © 2011-2022 走看看