![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | File search i wrote this vbscript to search office files in the PC hard drive. but it returns more than 37xxx files result. it only has 2 office files anything i missed? file attributes? i find the 1st variable (QWord) sum up itself many times. thanks for your help. tony ********************************************* For Each Subfolder in Folder.SubFolders if Subfolder.name <> "Windows" and Subfolder.name <> "Program Files" and Subfolder.name <> "Default User" and Subfolder.name <> "RECYCLER" and Subfolder.name <> "All Users" and Subfolder.name <> "Media Player" then Set objFolder = objFSO.GetFolder(Subfolder.Path) Set colFiles = objFolder.Files For Each objFile in colFiles If right(objfile.name,3) = "doc" or right(objfile.name,4) = "docx" Then QWord = QWord + 1 ElseIf right(objfile.name,3) = "xls" or right(objfile.name,4) = "xlsx" Then QExcel = QExcel + 1 ElseIf right(objfile.name,3) = "mdb" or right(objfile.name,5) = "accdb" Then QAccess = QAccess + 1 End If Next Set colFiles = Nothing end if Next |
My System Specs![]() |
| | #2 (permalink) |
| | Re: File search sorry it should be i wrote this vbscript to "COUNT" office files in the PC hard drive. "Tony WONG" <x34@xxxxxx> ¼¶¼g©ó¶l¥ó·s»D:%23TUmtVb1IHA.2292@xxxxxx Quote: >i wrote this vbscript to search office files in the PC hard drive. > > but it returns more than 37xxx files result. > > it only has 2 office files > > anything i missed? file attributes? > > i find the 1st variable (QWord) sum up itself many times. > > thanks for your help. > > tony > > ********************************************* > For Each Subfolder in Folder.SubFolders > if Subfolder.name <> "Windows" and Subfolder.name <> "Program Files" > and Subfolder.name <> "Default User" and Subfolder.name <> "RECYCLER" and > Subfolder.name <> "All Users" and Subfolder.name <> "Media Player" then > Set objFolder = objFSO.GetFolder(Subfolder.Path) > Set colFiles = objFolder.Files > For Each objFile in colFiles > If right(objfile.name,3) = "doc" or right(objfile.name,4) = "docx" > Then > QWord = QWord + 1 > ElseIf right(objfile.name,3) = "xls" or right(objfile.name,4) = "xlsx" > Then > QExcel = QExcel + 1 > ElseIf right(objfile.name,3) = "mdb" or right(objfile.name,5) = "accdb" > Then > QAccess = QAccess + 1 > End If > Next > Set colFiles = Nothing > end if > Next > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: File search ignore me. thx. "Tony WONG" <x34@xxxxxx> ¼¶¼g©ó¶l¥ó·s»D:%235VnWZb1IHA.4040@xxxxxx Quote: > sorry it should be > i wrote this vbscript to "COUNT" office files in the PC hard drive. > > > "Tony WONG" <x34@xxxxxx> ¼¶¼g©ó¶l¥ó·s»D:%23TUmtVb1IHA.2292@xxxxxx Quote: >>i wrote this vbscript to search office files in the PC hard drive. >> >> but it returns more than 37xxx files result. >> >> it only has 2 office files >> >> anything i missed? file attributes? >> >> i find the 1st variable (QWord) sum up itself many times. >> >> thanks for your help. >> >> tony >> >> ********************************************* >> For Each Subfolder in Folder.SubFolders >> if Subfolder.name <> "Windows" and Subfolder.name <> "Program Files" >> and Subfolder.name <> "Default User" and Subfolder.name <> "RECYCLER" and >> Subfolder.name <> "All Users" and Subfolder.name <> "Media Player" then >> Set objFolder = objFSO.GetFolder(Subfolder.Path) >> Set colFiles = objFolder.Files >> For Each objFile in colFiles >> If right(objfile.name,3) = "doc" or right(objfile.name,4) = "docx" >> Then >> QWord = QWord + 1 >> ElseIf right(objfile.name,3) = "xls" or right(objfile.name,4) = "xlsx" >> Then >> QExcel = QExcel + 1 >> ElseIf right(objfile.name,3) = "mdb" or right(objfile.name,5) = "accdb" >> Then >> QAccess = QAccess + 1 >> End If >> Next >> Set colFiles = Nothing >> end if >> Next >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Batch file to search file. | .NET General | |||
| File search | Vista file management | |||
| search- how to search with in a word file | Vista General | |||
| Cannot search by file name | Vista file management | |||
| search by file type....and other ways I could search in XP | Vista file management | |||