Windows Vista Forums

Scanning Local Drives and Local folders
  1. #1


    BarbS Guest

    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

  2. #2


    Al Dunbar Guest

    Re: Scanning Local Drives and Local folders


    "BarbS" <BarbS@xxxxxx> wrote in message
    news:E4378B48-FDF2-40BA-963C-1E7A8B9F08AD@xxxxxx

    >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.

    > ----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

  3. #3


    BarbS Guest

    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:

    >
    > "BarbS" <BarbS@xxxxxx> wrote in message
    > news:E4378B48-FDF2-40BA-963C-1E7A8B9F08AD@xxxxxx

    > >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.
    >

    > > ----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

Scanning Local Drives and Local folders problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows cannot bind to XXXXXXXXXXXX.local domain. (Local Error). G Jason Boull, MCP SBS Server 5 27 Jan 2010
Add local machine users to local admin group via GPO Andrew .NET General 0 10 Jun 2008
VPC 2007 can't access local network drives over VPN Tone Southerland Virtual PC 0 29 May 2008
Two Ethernet Cards, local shows as limited instead of as local Deathwing00 Vista networking & sharing 10 15 Jun 2007
Local Folders Pat Vista mail 1 07 Jun 2007