Public Property Let oFS(objOFS) m_oFS = objOFS End Property …… Sub init(strRoot) 'Root to Search (c:, d:, e:) Dim oDrive, oRootDir IF oFS.FolderExists(strRoot) Then IF Len(strRoot) < 3 Then 'Must Be a Drive Set oDrive = oFS.GetDrive(strRoot) Set oRootDir = oDrive.RootFolder Else Set oRootDir = oFS.GetFolder(strRoot) End IF Else EchoB("噢,文件夹( " & strRoot & " )没找到!") Exit Sub End IF setRoot = oRootDir
Echo("") BuildOptions End Sub
Sub getAllDlls(oParentFolder) Dim oSubFolders, oFile, oFiles Set oSubFolders = oParentFolder.SubFolders Set opFiles = oParentFolder.Files
For Each oFile in opFiles IF Right(lCase(oFile.Name), 4) = ".dll" OR Right(lCase(oFile.Name), 4) = ".ocx" Then Echo("") End IF Next
On Error Resume Next For Each oFolder In oSubFolders 'Iterate All Folders in Drive Set oFiles = oFolder.Files For Each oFile in oFiles IF Right(lCase(oFile.Name), 4) = ".dll" OR Right(lCase(oFile.Name), 4) = ".ocx" Then Echo("") End IF Next Call getAllDlls(oFolder) Next On Error GoTo 0 End Sub
Sub Register(strFilePath, regMethod) Dim theFile, strFile, oShell, exitcode Set theFile = oFS.GetFile(strFilePath) strFile = theFile.Path