Skip navigation

How can I use a script to determine the number of processors in a machine?

A. You can use a Windows Management Instrumentation (WMI) script to easily ascertain the number of processors on a machine. To do so, use these VBScript commands in a script file:

Set oShell = WScript.CreateObject("WScript.Shell")
Set oEnv = oShell.Environment("SYSTEM")
WScript.Echo oEnv("NUMBER_OF_PROCESSORS")
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish