inventory help

Posted: 08-25-2006, 02:20 PM
just getting started.......this is simple to some of you.....
trying to get inventory......... found this one and it doesn't work.....

how do i run it to output html?

'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


--
Learning Scripting.....
Reply With Quote

Responses to "inventory help"

 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Hypertext Applications Demo Site with Windows 2000/XP/2003 Inventory Software DrTechMech Windows XP WMI 0 09-19-2005 03:45 AM
using WMI for computer inventory Cary Shultz [A.D. MVP] Windows XP WMI 9 06-24-2005 08:52 AM
inventory of mounted drives (which class?) Steven Platt Windows XP WMI 4 04-29-2005 07:56 PM
mini-computer inventory Cary Shultz [A.D. MVP] Windows XP WMI 6 11-11-2004 04:58 PM


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90