A script to find out which servers have a web.config file

Can someone help me to write a vbs/dos batch script to find out which servers have a web.config file

Thanks
rakkadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brett DanneyIT ArchitectCommented:
I have attached a vb script file and a txt file. Place both files in c:\scripts then open the serverList.txt file and add the servers you would like to check for the web.config file. One server per line.
In the script file set the path you would exspect to find the web.config file (line 37)
Run the FileCheck.vbs script.
FileCheck.vbs
Server-list.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rakkadAuthor Commented:
Can't you do a script that will search the local computer of all drives and find the presence of the web.config file

Thanks
0
Lionel MMSmall Business IT ConsultantCommented:
a quick and simple way for a local computer it to use dir but you would have to do disk by disk
dir c:\web.config /s
dir d:\web.config /s
If you want the results to go to a log file then you can do this
dir c:\web.config /s >C:\Logs\WebConfig.txt
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

rakkadAuthor Commented:
Can this be done via your vb script ? So it will search via the serverlist.txt and check for any drives that has a web.config file

Thanks
0
Brett DanneyIT ArchitectCommented:
Change line 36 in the VBS file to this:

ExecQuery("Select * From CIM_DataFile Where FileName = 'web.config'")

That will search all local drives.
0
Lionel MMSmall Business IT ConsultantCommented:
The only way I know of to be able to use your serverlist.txt on remote servers is to use a utility like psexec http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx to run DIR on a remote server. It may be best to use the vb scipt suggested by SagiEDoc but if you do want to install psexec then this is what you will psexec @C:\serverlist.txt) "dir c:\web.config /s"
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.