tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 VB Script > Advanced > Computer Info

Computer Info 

This example shows accessing computer information.

File Name  :  
source/VBS/advanced/comp_info.vbs 
Author  :  Sudhakar KV
Email  :  kvenkatasudhakar@gmail.com
01'Local computer
02strCompName = "."
03 
04Set wmiSvcObj = GetObject("winmgmts:\\" & strCompName & "\root\CIMV2")
05Set selComps = wmiSvcObj.ExecQuery("SELECT * FROM Win32_ComputerSystem")
06 
07For Each compObj In selComps
08  WScript.Echo "Computer Name: " & compObj.Name
09  WScript.Echo "System Type: " & compObj.SystemType
10  WScript.Echo "Number Of Processors: " & compObj.NumberOfProcessors
11 
12  WScript.Echo "Manufacturer: " & compObj.Manufacturer
13  WScript.Echo "Model: " & compObj.Model
14Next

It gives the following output,
Computer Name: BETHECODER
System Type: X86-based PC
Number Of Processors: 1
Manufacturer: Dell Inc.
Model: Latitude E6400



 
  


  
bl  br