Solved

Not understanding what is wrong with a VBS script.

Posted on 2013-11-11
2
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

IoT Devices - Fast, Cheap or Secure…Pick Two

The IoT market is growing at a rapid pace and manufacturers are under pressure to quickly provide new products. Can you be sure that your devices do what they're supposed to do, while still being secure?

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Progress
Suggested Courses
Course of the Month5 days, 12 hours left to enroll

626 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