List Basic Hardware and Software Information

Submitted By: Rully Kusuma

Language: VBScript

Description: Returns basic information about a workstation, including such things as BIOS asset tag, processors, RAM and hard drive size, and programs installed.

Script Code

'On Error Resume next

Dim TotalRam

ComputerName = InputBox ("Enter the computer name :" & chr(13) & chr(13) & _
"Leave it blank for local machine", "Computer Basic Info")

If ComputerName = Empty Then ComputerName = "."

Set Output = CreateObject("Scripting.FileSystemObject")
Set WshShell = Wscript.CreateObject("WScript.Shell")
Set WMIService = GetObject ("winmgmts:\\" & ComputerName & "\root\cimv2")
Set BIOSInfoList = WMIService.ExecQuery("Select * from Win32_BIOS",,48)
Set CompSysList = WMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
Set ProcessorList = WMIService.ExecQuery("Select * from Win32_Processor",,48)
Set GETTIA = WMIService.ExecQuery("Select * from Win32_Environment Where Name = 'TIA'",,48)
Set HDList = WMIService.ExecQuery _
("Select * from Win32_LogicalDisk Where Description = 'Local Fixed Disk'",,48)
Set RAMList = WMIService.ExecQuery("Select * from Win32_PhysicalMemory",,48)
Set AppList = WMIService.ExecQuery("Select * from Win32Reg_AddRemovePrograms",,48)
Set NetList = WMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled = True",,48)

TotalRAM = 0

Set OutputFile = Output.CreateTextFile("C:\Temp\" & ComputerName & ".txt", true)
OutputFile.Writeline "This info is for " & ComputerName & " captured at " & Now
OutputFile.WriteBlankLines 1

For Each BIOSInfoItem in BIOSInfoList
	OutputFile.Writeline "Manufacturer		: " & BIOSInfoItem.Manufacturer
	OutputFile.Writeline "BIOS Name		: " & BIOSInfoItem.Name
	OutputFile.Writeline "Dell Service Tag	: " & BIOSInfoItem.SerialNumber
Next

For Each TIANumber in GETTIA
	OutputFile.WriteLine "TIA Number		: " & TIANumber.VariableValue
Next

For Each CompSysItem in CompSysList
	OutputFile.Writeline "Computer Model 		: " & CompSysItem.Model
	OutputFile.WriteLine "Logged-in User 		: " & CompSysItem.UserName
Next

For Each ProcessorItem in ProcessorList
	OutputFile.Writeline "Processor Name		: " & ProcessorItem.Name
Next

For Each RAMItem in RAMList
	TotalRAM = TotalRAM + RAMItem.Capacity
Next

OutputFile.WriteLine "RAM Capacity		: " & TotalRAM/1048576 & " MB"

For Each HDItem in HDList
	outputFile.Writeline "Total HD space		: " & HDItem.Size/1000000000 & " GB"
	OutputFile.Writeline "Available Free Space	: " & HDItem.FreeSpace/1000000000 & " GB"
Next

For Each NetItem in NetList
	strIPAddress = Join (NetItem.IPAddress,",")
	OutputFile.Writeline "IP Address		: " & strIPAddress
Next

OutputFile.WriteBlankLines 1

OutputFile.WriteLine "Add Remove Programs List :"

For Each AppItem in AppList
	OutputFile.Writeline AppItem.DisplayName & "					" & AppItem.Version
Next

WshShell.Run "Notepad " & "C:\Temp\" & Computername & ".txt", 1

Set ComputerName = Nothing
Set WMIService = Nothing
WScript.Quit

Note: Not all scripts run on all versions of Windows.

For online peer support, join The Official Scripting Guys Forum! To provide feedback or report bugs in sample scripts or on the Script Center, please contact scripter@microsoft.com.

Disclaimer

This script is not supported under any Microsoft standard support program or service. The script is provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the script and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the script be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the script or documentation, even if Microsoft has been advised of the possibility of such damages.


Top of pageTop of page