"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