|
Prev: Run setup.exe from netshare
Next: DirectX Version
From: Tony WONG on 24 Jun 2008 00:47 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
From: Tony WONG on 24 Jun 2008 00:54 sorry it should be i wrote this vbscript to "COUNT" office files in the PC hard drive. "Tony WONG" <x34(a)netvigator.com> ���g��l��s�D:%23TUmtVb1IHA.2292(a)TK2MSFTNGP03.phx.gbl... >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 >
From: Tony WONG on 24 Jun 2008 05:00 ignore me. thx. "Tony WONG" <x34(a)netvigator.com> ���g��l��s�D:%235VnWZb1IHA.4040(a)TK2MSFTNGP04.phx.gbl... > sorry it should be > i wrote this vbscript to "COUNT" office files in the PC hard drive. > > > "Tony WONG" <x34(a)netvigator.com> ���g��l��s�D:%23TUmtVb1IHA.2292(a)TK2MSFTNGP03.phx.gbl... >>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 >> > >
|
Pages: 1 Prev: Run setup.exe from netshare Next: DirectX Version |