WMI Gets Computer Information

Source: Internet
Author: User

On Error Resume Next
StrComputer = "."
Strinfo = ""
Set objWMIService = GetObject ("winmgmts:\\" & StrComputer & "\root\cimv2")

Set colitems = objWMIService.ExecQuery ("SELECT * from Win32_BIOS", 48)
For each objitem in colitems
Strinfo = Strinfo & "SerialNumber:" & Objitem.serialnumber & VbCrLf
Next

Set colitems = objWMIService.ExecQuery ("SELECT * from Win32_ComputerSystem", ",")
for each objitem in Colitems
& Nbsp;strinfo = Strinfo & "UserName:" & objitem.username & vbCrLf
 strinfo = strinfo & "Computerna Me: "& objItem.Name & vbCrLf
 strinfo = strinfo &" Domain: "& Objitem.domain & vbCrLf
&nb Sp;strinfo = strinfo & "Manufacturer:" & objitem.manufacturer & vbCrLf
 strinfo = strinfo & "Mode L: "& Objitem.model & vbCrLf
 strinfo = strinfo &" TotalPhysicalMemory: "& Round (Objitem.totalph ysicalmemory/(1024^2), 0) & "M" & vbCrLf
Next

Set colitems = objWMIService.ExecQuery ("SELECT * from Win32_Processor", 48)
For each objitem in colitems
If processornumber = 0 Then
Strinfo = Strinfo & "Processormaxclockspeed:" & Round (objitem.maxclockspeed/1024,1) & "G" & VbCrLf
Strinfo = Strinfo & "Processorname:" & objItem.Name & VbCrLf
End If
Processornumber = Processornumber + 1
Next
Strinfo = Strinfo & "Processornumber:" & Processornumber & VbCrLf

WScript.Echo Strinfo

WMI Gets Computer Information

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.