Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Scanning Local Drives and Local folders

Reply
 
Old 09-17-2008   #1 (permalink)
BarbS


 
 

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 SpecsSystem Spec
Old 09-18-2008   #2 (permalink)
Al Dunbar


 
 

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.
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 SpecsSystem Spec
Old 09-18-2008   #3 (permalink)
BarbS


 
 

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 SpecsSystem Spec
Reply

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46