![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Scanning Local Drives and Local folders I am trying to write a script to list folders on my local drives. The goal is to search for word documents and spreadsheets on our users hard drives. The following basic script is a start. I am log onto my computer as a domain admin. The script starts scanning but gives me access denied when it reaches \document and settings\administrator folder. If I can not get this to work on my computer, I will not be able to get it to work on remote computers. Thank you for any help. ----script---------- Set FSO = CreateObject("Scripting.FileSystemObject") ShowSubfolders FSO.GetFolder("C:\") Sub ShowSubFolders(Folder) For Each Subfolder in Folder.SubFolders Wscript.Echo Subfolder.Path ShowSubFolders Subfolder Next End Sub |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Scanning Local Drives and Local folders "BarbS" <BarbS@xxxxxx> wrote in message news:E4378B48-FDF2-40BA-963C-1E7A8B9F08AD@xxxxxx Quote: >I am trying to write a script to list folders on my local drives. The goal >is > to search for word documents and spreadsheets on our users hard drives. > The > following basic script is a start. I am log onto my computer as a domain > admin. The script starts scanning but gives me access denied when it > reaches > \document and settings\administrator folder. If I can not get this to work > on > my computer, I will not be able to get it to work on remote computers. > Thank > you for any help. "administrators" group. Sorry, but you will have to find a way to do this using an account that is a local admin - or possibly a local power user. Quote: > ----script---------- > > Set FSO = CreateObject("Scripting.FileSystemObject") > ShowSubfolders FSO.GetFolder("C:\") > Sub ShowSubFolders(Folder) > For Each Subfolder in Folder.SubFolders > Wscript.Echo Subfolder.Path > ShowSubFolders Subfolder > Next > End Sub for /f %%C in (computerlist.txt) do ( ( dir /s \\%%C\c$\*.doc dir /s \\%%C\c$\*.xls )<%%C.log ) I run scripts like that from my own workstation using a domain account that is a local administrator on the workstations of interest. /Al |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Scanning Local Drives and Local folders Thank You. I have "domain admins" listed in the local administrator grouup. Will try your suggestion. Thanks again. "Al Dunbar" wrote: Quote: > > "BarbS" <BarbS@xxxxxx> wrote in message > news:E4378B48-FDF2-40BA-963C-1E7A8B9F08AD@xxxxxx Quote: > >I am trying to write a script to list folders on my local drives. The goal > >is > > to search for word documents and spreadsheets on our users hard drives. > > The > > following basic script is a start. I am log onto my computer as a domain > > admin. The script starts scanning but gives me access denied when it > > reaches > > \document and settings\administrator folder. If I can not get this to work > > on > > my computer, I will not be able to get it to work on remote computers. > > Thank > > you for any help. > The domain admin account is obviously not a member of the local > "administrators" group. Sorry, but you will have to find a way to do this > using an account that is a local admin - or possibly a local power user. > Quote: > > ----script---------- > > > > Set FSO = CreateObject("Scripting.FileSystemObject") > > ShowSubfolders FSO.GetFolder("C:\") > > Sub ShowSubFolders(Folder) > > For Each Subfolder in Folder.SubFolders > > Wscript.Echo Subfolder.Path > > ShowSubFolders Subfolder > > Next > > End Sub > This kind of thing can be easier to accomplish in batch than in vbscript: > > for /f %%C in (computerlist.txt) do ( > ( > dir /s \\%%C\c$\*.doc > dir /s \\%%C\c$\*.xls > )<%%C.log > ) > > I run scripts like that from my own workstation using a domain account that > is a local administrator on the workstations of interest. > > /Al > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Local Folders | Live Mail | |||
| Add local machine users to local admin group via GPO | .NET General | |||
| VPC 2007 can't access local network drives over VPN | Virtual PC | |||
| cant get rid of local folders | Vista mail | |||
| Two Ethernet Cards, local shows as limited instead of as local | Vista networking & sharing | |||