Hi Nquizitive,
Copy the code notepad and save the file with .vbs extension (e.g. systeminfo.vbs) then double-click file to execute the script.
The script uses WMI to query the machine for system information. When you execute the script it performs following steps:
1. Connect to the WMI service
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
2. Retrieve Instances of WMI managed Resources
Code:
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
3. Echo the value of properties
Code:
Wscript.Echo "OS Name: " & objOperatingSystem.Name
Wscript.Echo "Version: " & objOperatingSystem.Version
Wscript.Echo "Service Pack: " & _
objOperatingSystem.ServicePackMajorVersion _
& "." & objOperatingSystem.ServicePackMinorVersion
Wscript.Echo "OS Manufacturer: " & objOperatingSystem.Manufacturer
Wscript.Echo "Windows Directory: " & _
objOperatingSystem.WindowsDirectory
Wscript.Echo "Locale: " & objOperatingSystem.Locale
Wscript.Echo "Available Physical Memory: " & _
objOperatingSystem.FreePhysicalMemory
Wscript.Echo "Total Virtual Memory: " & _
objOperatingSystem.TotalVirtualMemorySize
Wscript.Echo "Available Virtual Memory: " & _
objOperatingSystem.FreeVirtualMemory
Wscript.Echo "Size stored in paging files: " & _
objOperatingSystem.SizeStoredInPagingFiles
Using WMI you can query a wide variety of system information. Check out these scripts
http://www.microsoft.com/technet/scr...e/default.mspx
Bookmarks