Solved

Not understanding what is wrong with a VBS script.

Posted on 2013-11-11
2
309 Views
Last Modified: 2013-11-11
Hi guys,

Can any of you tell me what's wrong with this script? It keeps giving me a syntax error in line 3 character 1, and I'm not able to figure out why. Thanks in advance.

strComputer = "Computername"

Set objWMIService = GetObject("winmgmt:\\" & strComputer & "\root\cimv2")

Set colProcessors = objWMIService.ExecQuery("Select * from Win32_Processor")

For Each objProcessor in colProcessors
    WScript.Echo objProcessor.AddressWidth     'or  objProcessor.DataWidth
    Exit For
Next
0
Comment
Question by:roycbene
2 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 39639307
Set objWMIService = GetObject("winmgmt:\\" & strComputer & "\root\cimv2")

should be

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
0
 
LVL 3

Author Comment

by:roycbene
ID: 39639337
Thanks, Jacko! You rock!!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Is online banking safe? 11 81
Save Exchange PowerShell Command 12 29
Java array 10 55
ADFS:  Step by Step to enable MFA with ADFS 16 29
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

713 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