清除acaddoc.lsp

Set fso = CreateObject("Scripting.FileSystemObject")
input=InputBox("输入目录")
If input="" Then WScript.Quit
Set objFolder = fso.GetFolder(input)
Search(objFolder)
Function Search(objFolder)
For Each objFile In objFolder.Files
od = fso.GetFileName(objFile)
If od="acaddoc.lsp" Then
  Set fn=fso.OpenTextFile(fso.GetFile(objFile).Path,1)
  Do While fn.AtEndOfStream<>True
   s=fn.ReadLine
   If s="""boot.dat""" Then
    fn.close
     fso.DeleteFile(objFile)
    Exit Do
   End If
Loop
End If
Next
For Each objSubFolder In objFolder.SubFolders
Search(objSubFolder)
Next
End Function

 

你可能感兴趣的:(input,search,function,each)