Solved

Object Not a Collection

Posted on 2011-09-28
1
271 Views
Last Modified: 2012-05-12
I have a script that modfies the user account and password used for a windows service, but I have issues with running it, I get 'Object Not a Collection'.


Option Explicit
dim strComputer, objWMIService, colServiceList,colServices,objService
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_Service WHERE StartName = '.\\Scheduler'")
For Each objService in colServices
 errServiceChange = objService.Change _
 ( , , , , , , ".\TESTDOMAN\svcuser" , "santa10")
Next

Open in new window

0
Comment
Question by:rimmena
1 Comment
 
LVL 10

Accepted Solution

by:
ienaxxx earned 500 total points
ID: 36720117
u're trying to recall colservicelist as colservices in the loop declaration
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now