|
Each contribution is licensed to you under a License Agreement by its owner, not Microsoft. Microsoft does not guarantee the contribution or purport to grant rights to it.
|
Categories |
List Basic Hardware and Software Information(Community)
Script Code
VBScript
'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
Platforms
For online peer support, join
The Official Scripting Guys Forum!
To provide feedback or report bugs in sample scripts, please start a new discussion on the Discussions tab for this script.
Disclaimer
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are 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 sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts 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 sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.
Be the first to create a discussion.
|