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
Solved

Not understanding what is wrong with a VBS script.

Posted on 2013-11-11
2
308 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article will help you understand what HashTables are and how to use them in PowerShell.
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

856 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