Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Program to get hardware info?

Reply
 
Old 07-21-2009   #1 (permalink)
steve


 
 

Program to get hardware info?

I'm not a vbs script person I admit. I kind of poke around and glue a
few things together to get what I need.

In this case I need a simple program that can print out basic info
about a computer so that we can paste it on top of the cases for a
quick summary of what is in the case.

I found this nice little vbs script that does almost what I want.
However I want to add a few more features to it to give some
additional info.

What is missing in it is ...

I want the Name of the C drive (we actually give the drives a Serial
number that tells us the SN of the comptuer)

I want the video card info basic model and info,

I want the Nic info. eg what type of card it is so that we can know
what drivers it needs

What USB ports are available,

And I think finally the MB info that is what is the MB Mnf, and data
so that if we need drivers for it we can find them.

The rest is covered by the program that I have edited.

I have looked but I cant seem to find the information I need to edit
this file and give me the output I would like. Again Im just basic in
my scripting abilities.

save and rename hardware.vbs
----------------
'==========================================================================
'
' NAME: <MemProcDiskInventory.vbs>
'
' AUTHOR: Mark D. MacLachlan , ITSynergy
' DATE : 5/15/2003
'
' COMMENT: <Inventories computer configuration and writes report to
disk>
'==========================================================================
on error resume Next

Set oShell = CreateObject("wscript.Shell")
Set env = oShell.environment("Process")
strComputer = env.Item("Computername")
Const HKEY_LOCAL_MACHINE = &H80000002
Const UnInstPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
\"
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
".\root\default:StdRegProv")


report = strComputer & " Computer Inventory" & vbCrLf &
"******************************************" & vbCrLf & vbCrLf
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem",,48)

report = report & vbCrLf &
"******************************************" & vbCrLf
report = report & "OS Information" & vbCrLf &
"******************************************" & vbCrLf & vbCrLf
For Each objItem in colItems
report = report & strComputer & vbCrLf & "OS Details"& vbCrlf
report = report & "Caption: " & objItem.Caption & vbCrLf
report = report & "Description: " & objItem.Description & vbCrLf
report = report & "InstallDate: " & objItem.InstallDate & vbCrLf
report = report & "Manufacturer: " & objItem.Manufacturer &
vbCrLf
report = report & "Name: " & objItem.Name & vbCrLf
report = report & "Organization: " & objItem.Organization &
vbCrLf
report = report & "RegisteredUser: " & objItem.RegisteredUser &
vbCrLf
report = report & "SerialNumber: " & objItem.SerialNumber &
vbCrLf
report = report & "ServicePackMajorVersion: " &
objItem.ServicePackMajorVersion & vbCrLf
report = report & "ServicePackMinorVersion: " &
objItem.ServicePackMinorVersion & vbCrLf
report = report & "Version: " & objItem.Version & vbCrLf
Next

Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
report = report & vbCrLf &
"******************************************" & vbCrLf
report = report & "Memory and Processor Information" & vbCrLf &
"******************************************" & vbCrLf & vbCrLf
For Each objComputer in colSettings
report = report & objComputer.TotalPhysicalMemory /1024\1024+1 & "MB
Total memory" & vbcrlf
Next
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_Processor")
For Each objProcessor in colSettings
report = report & objProcessor.Description & " Processor" & vbCrLf
Next

report = report & vbCrLf &
"******************************************" & vbCrLf
report = report & "Disk Drive Information" & vbCrLf &
"******************************************" & vbCrLf & vbCrLf

Set objWMIService = GetObject("winmgmts:")
Set objLogicalDisk = objWMIService.Get
("Win32_LogicalDisk.DeviceID='c:'")
report = report & objLogicalDisk.FreeSpace /1024\1024+1 & "MB Free
Disk Space" & vbCrLf
report = report & objLogicalDisk.Size /1024\1024+1 & "MB Total Disk
Space" & vbCrLf


Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.CreateTextFile (strComputer & ".txt", ForWriting)
ts.write report
ts.write software
MsgBox Report
MsgBox "Done"





My System SpecsSystem Spec
Old 07-21-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: Program to get hardware info?


"steve" <stevesemple@xxxxxx> wrote in message
news:dd2a86f0-7e78-4ebf-89c5-f329c08ca50d@xxxxxx
Quote:

> I'm not a vbs script person I admit. I kind of poke around and glue a
> few things together to get what I need.
>
> In this case I need a simple program that can print out basic info
> about a computer so that we can paste it on top of the cases for a
> quick summary of what is in the case.
>
> I found this nice little vbs script that does almost what I want.
> However I want to add a few more features to it to give some
> additional info.
>
> What is missing in it is ...
>
> I want the Name of the C drive (we actually give the drives a Serial
> number that tells us the SN of the comptuer)
>
> I want the video card info basic model and info,
>
> I want the Nic info. eg what type of card it is so that we can know
> what drivers it needs
>
> What USB ports are available,
>
> And I think finally the MB info that is what is the MB Mnf, and data
> so that if we need drivers for it we can find them.
>
> The rest is covered by the program that I have edited.
>
> I have looked but I cant seem to find the information I need to edit
> this file and give me the output I would like. Again Im just basic in
> my scripting abilities.
>
> save and rename hardware.vbs
> ----------------
> '==========================================================================
> '
> ' NAME: <MemProcDiskInventory.vbs>
> '
> ' AUTHOR: Mark D. MacLachlan , ITSynergy
> ' DATE : 5/15/2003
> '
> ' COMMENT: <Inventories computer configuration and writes report to
> disk>
> '==========================================================================
> on error resume Next
>
> Set oShell = CreateObject("wscript.Shell")
> Set env = oShell.environment("Process")
> strComputer = env.Item("Computername")
> Const HKEY_LOCAL_MACHINE = &H80000002
> Const UnInstPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
> \"
> Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
> ".\root\default:StdRegProv")
>
>
> report = strComputer & " Computer Inventory" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
> \cimv2")
> Set colItems = objWMIService.ExecQuery("Select * from
> Win32_OperatingSystem",,48)
>
> report = report & vbCrLf &
> "******************************************" & vbCrLf
> report = report & "OS Information" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
> For Each objItem in colItems
> report = report & strComputer & vbCrLf & "OS Details"& vbCrlf
> report = report & "Caption: " & objItem.Caption & vbCrLf
> report = report & "Description: " & objItem.Description & vbCrLf
> report = report & "InstallDate: " & objItem.InstallDate & vbCrLf
> report = report & "Manufacturer: " & objItem.Manufacturer &
> vbCrLf
> report = report & "Name: " & objItem.Name & vbCrLf
> report = report & "Organization: " & objItem.Organization &
> vbCrLf
> report = report & "RegisteredUser: " & objItem.RegisteredUser &
> vbCrLf
> report = report & "SerialNumber: " & objItem.SerialNumber &
> vbCrLf
> report = report & "ServicePackMajorVersion: " &
> objItem.ServicePackMajorVersion & vbCrLf
> report = report & "ServicePackMinorVersion: " &
> objItem.ServicePackMinorVersion & vbCrLf
> report = report & "Version: " & objItem.Version & vbCrLf
> Next
>
> Set colSettings = objWMIService.ExecQuery _
> ("Select * from Win32_ComputerSystem")
> report = report & vbCrLf &
> "******************************************" & vbCrLf
> report = report & "Memory and Processor Information" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
> For Each objComputer in colSettings
> report = report & objComputer.TotalPhysicalMemory /1024\1024+1 & "MB
> Total memory" & vbcrlf
> Next
> Set colSettings = objWMIService.ExecQuery _
> ("Select * from Win32_Processor")
> For Each objProcessor in colSettings
> report = report & objProcessor.Description & " Processor" & vbCrLf
> Next
>
> report = report & vbCrLf &
> "******************************************" & vbCrLf
> report = report & "Disk Drive Information" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
>
> Set objWMIService = GetObject("winmgmts:")
> Set objLogicalDisk = objWMIService.Get
> ("Win32_LogicalDisk.DeviceID='c:'")
> report = report & objLogicalDisk.FreeSpace /1024\1024+1 & "MB Free
> Disk Space" & vbCrLf
> report = report & objLogicalDisk.Size /1024\1024+1 & "MB Total Disk
> Space" & vbCrLf
>
>
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set ts = fso.CreateTextFile (strComputer & ".txt", ForWriting)
> ts.write report
> ts.write software
> MsgBox Report
> MsgBox "Done"
In my book the above script is not exactly my idea of a "nice little
script" - it's a full-blown WMI program. You might find some of the items
you need here: http://dieseyer.de/scr-html/hardwareinventur.html. You will
have to do a fair bit of glueing to merge it with your existing script.


My System SpecsSystem Spec
Old 07-21-2009   #3 (permalink)
mayayana


 
 

Re: Program to get hardware info?

See here for another version that provides a
different set of info.:
www.jsware.net/jsware/scripts.php5#sysinf

(See the WMI Hardware Survey.vbs script in the
download.)

What you really need is the help file, wmisdk.chm.
Then you can look up the available objects
and properties for yourself. I couldn't find a valid link for
the WMI SDK just now. Microsoft has increasingly
been providing links only for the current Win32 SDK,
while removing links for specific downloads.
That seems to be what they're doing now with WMI.
If you follow the MS WMI links you end up either finding
broken links or getting dumped here, at the general
SDK download page:
http://msdn.microsoft.com/en-us/wind.../bb980924.aspx

That means you're faced with downloading a
gigantic SDK, which is connected to the .Net
system, and uses the .Net help file format. It
may or may not have a scripting version of the
WMI help file.

Also note that the WMI methods do not always
work. It depends on the hardware. For instance, I
can get the BIOS maker and version on my system,
but I don't get anything in terms of motherboard info.
When I retrieve the Description for Onboard Devices
I get "To Be Filled By O.E.M.". Which doesn't help very
much. I built the PC so I'm the OEM.

If you don't have too many different configurations
to deal with you might be better off just documenting
the hardware via the original manual(s) and/or OEM serial
number.
Quote:

> I'm not a vbs script person I admit. I kind of poke around and glue a
> few things together to get what I need.
>
> In this case I need a simple program that can print out basic info
> about a computer so that we can paste it on top of the cases for a
> quick summary of what is in the case.
>
> I found this nice little vbs script that does almost what I want.
> However I want to add a few more features to it to give some
> additional info.
>
> What is missing in it is ...
>
> I want the Name of the C drive (we actually give the drives a Serial
> number that tells us the SN of the comptuer)
>
> I want the video card info basic model and info,
>
> I want the Nic info. eg what type of card it is so that we can know
> what drivers it needs
>
> What USB ports are available,
>
> And I think finally the MB info that is what is the MB Mnf, and data
> so that if we need drivers for it we can find them.
>
> The rest is covered by the program that I have edited.
>
> I have looked but I cant seem to find the information I need to edit
> this file and give me the output I would like. Again Im just basic in
> my scripting abilities.
>
> save and rename hardware.vbs
> ----------------
>
'==========================================================================
Quote:

> '
> ' NAME: <MemProcDiskInventory.vbs>
> '
> ' AUTHOR: Mark D. MacLachlan , ITSynergy
> ' DATE : 5/15/2003
> '
> ' COMMENT: <Inventories computer configuration and writes report to
> disk>
>
'==========================================================================
Quote:

> on error resume Next
>
> Set oShell = CreateObject("wscript.Shell")
> Set env = oShell.environment("Process")
> strComputer = env.Item("Computername")
> Const HKEY_LOCAL_MACHINE = &H80000002
> Const UnInstPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
> \"
> Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
> ".\root\default:StdRegProv")
>
>
> report = strComputer & " Computer Inventory" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
> \cimv2")
> Set colItems = objWMIService.ExecQuery("Select * from
> Win32_OperatingSystem",,48)
>
> report = report & vbCrLf &
> "******************************************" & vbCrLf
> report = report & "OS Information" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
> For Each objItem in colItems
> report = report & strComputer & vbCrLf & "OS Details"& vbCrlf
> report = report & "Caption: " & objItem.Caption & vbCrLf
> report = report & "Description: " & objItem.Description & vbCrLf
> report = report & "InstallDate: " & objItem.InstallDate & vbCrLf
> report = report & "Manufacturer: " & objItem.Manufacturer &
> vbCrLf
> report = report & "Name: " & objItem.Name & vbCrLf
> report = report & "Organization: " & objItem.Organization &
> vbCrLf
> report = report & "RegisteredUser: " & objItem.RegisteredUser &
> vbCrLf
> report = report & "SerialNumber: " & objItem.SerialNumber &
> vbCrLf
> report = report & "ServicePackMajorVersion: " &
> objItem.ServicePackMajorVersion & vbCrLf
> report = report & "ServicePackMinorVersion: " &
> objItem.ServicePackMinorVersion & vbCrLf
> report = report & "Version: " & objItem.Version & vbCrLf
> Next
>
> Set colSettings = objWMIService.ExecQuery _
> ("Select * from Win32_ComputerSystem")
> report = report & vbCrLf &
> "******************************************" & vbCrLf
> report = report & "Memory and Processor Information" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
> For Each objComputer in colSettings
> report = report & objComputer.TotalPhysicalMemory /1024\1024+1 & "MB
> Total memory" & vbcrlf
> Next
> Set colSettings = objWMIService.ExecQuery _
> ("Select * from Win32_Processor")
> For Each objProcessor in colSettings
> report = report & objProcessor.Description & " Processor" & vbCrLf
> Next
>
> report = report & vbCrLf &
> "******************************************" & vbCrLf
> report = report & "Disk Drive Information" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
>
> Set objWMIService = GetObject("winmgmts:")
> Set objLogicalDisk = objWMIService.Get
> ("Win32_LogicalDisk.DeviceID='c:'")
> report = report & objLogicalDisk.FreeSpace /1024\1024+1 & "MB Free
> Disk Space" & vbCrLf
> report = report & objLogicalDisk.Size /1024\1024+1 & "MB Total Disk
> Space" & vbCrLf
>
>
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set ts = fso.CreateTextFile (strComputer & ".txt", ForWriting)
> ts.write report
> ts.write software
> MsgBox Report
> MsgBox "Done"
>
>
>
>

My System SpecsSystem Spec
Old 07-21-2009   #4 (permalink)
Richard Mueller [MVP]


 
 

Re: Program to get hardware info?


"steve" <stevesemple@xxxxxx> wrote in message
news:dd2a86f0-7e78-4ebf-89c5-f329c08ca50d@xxxxxx
Quote:

> I'm not a vbs script person I admit. I kind of poke around and glue a
> few things together to get what I need.
>
> In this case I need a simple program that can print out basic info
> about a computer so that we can paste it on top of the cases for a
> quick summary of what is in the case.
>
> I found this nice little vbs script that does almost what I want.
> However I want to add a few more features to it to give some
> additional info.
>
> What is missing in it is ...
>
> I want the Name of the C drive (we actually give the drives a Serial
> number that tells us the SN of the comptuer)
>
> I want the video card info basic model and info,
>
> I want the Nic info. eg what type of card it is so that we can know
> what drivers it needs
>
> What USB ports are available,
>
> And I think finally the MB info that is what is the MB Mnf, and data
> so that if we need drivers for it we can find them.
>
> The rest is covered by the program that I have edited.
>
> I have looked but I cant seem to find the information I need to edit
> this file and give me the output I would like. Again Im just basic in
> my scripting abilities.
>
> save and rename hardware.vbs
> ----------------
> '==========================================================================
> '
> ' NAME: <MemProcDiskInventory.vbs>
> '
> ' AUTHOR: Mark D. MacLachlan , ITSynergy
> ' DATE : 5/15/2003
> '
> ' COMMENT: <Inventories computer configuration and writes report to
> disk>
> '==========================================================================
> on error resume Next
>
> Set oShell = CreateObject("wscript.Shell")
> Set env = oShell.environment("Process")
> strComputer = env.Item("Computername")
> Const HKEY_LOCAL_MACHINE = &H80000002
> Const UnInstPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
> \"
> Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
> ".\root\default:StdRegProv")
>
>
> report = strComputer & " Computer Inventory" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
> \cimv2")
> Set colItems = objWMIService.ExecQuery("Select * from
> Win32_OperatingSystem",,48)
>
> report = report & vbCrLf &
> "******************************************" & vbCrLf
> report = report & "OS Information" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
> For Each objItem in colItems
> report = report & strComputer & vbCrLf & "OS Details"& vbCrlf
> report = report & "Caption: " & objItem.Caption & vbCrLf
> report = report & "Description: " & objItem.Description & vbCrLf
> report = report & "InstallDate: " & objItem.InstallDate & vbCrLf
> report = report & "Manufacturer: " & objItem.Manufacturer &
> vbCrLf
> report = report & "Name: " & objItem.Name & vbCrLf
> report = report & "Organization: " & objItem.Organization &
> vbCrLf
> report = report & "RegisteredUser: " & objItem.RegisteredUser &
> vbCrLf
> report = report & "SerialNumber: " & objItem.SerialNumber &
> vbCrLf
> report = report & "ServicePackMajorVersion: " &
> objItem.ServicePackMajorVersion & vbCrLf
> report = report & "ServicePackMinorVersion: " &
> objItem.ServicePackMinorVersion & vbCrLf
> report = report & "Version: " & objItem.Version & vbCrLf
> Next
>
> Set colSettings = objWMIService.ExecQuery _
> ("Select * from Win32_ComputerSystem")
> report = report & vbCrLf &
> "******************************************" & vbCrLf
> report = report & "Memory and Processor Information" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
> For Each objComputer in colSettings
> report = report & objComputer.TotalPhysicalMemory /1024\1024+1 & "MB
> Total memory" & vbcrlf
> Next
> Set colSettings = objWMIService.ExecQuery _
> ("Select * from Win32_Processor")
> For Each objProcessor in colSettings
> report = report & objProcessor.Description & " Processor" & vbCrLf
> Next
>
> report = report & vbCrLf &
> "******************************************" & vbCrLf
> report = report & "Disk Drive Information" & vbCrLf &
> "******************************************" & vbCrLf & vbCrLf
>
> Set objWMIService = GetObject("winmgmts:")
> Set objLogicalDisk = objWMIService.Get
> ("Win32_LogicalDisk.DeviceID='c:'")
> report = report & objLogicalDisk.FreeSpace /1024\1024+1 & "MB Free
> Disk Space" & vbCrLf
> report = report & objLogicalDisk.Size /1024\1024+1 & "MB Total Disk
> Space" & vbCrLf
>
>
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set ts = fso.CreateTextFile (strComputer & ".txt", ForWriting)
> ts.write report
> ts.write software
> MsgBox Report
> MsgBox "Done"
>
>
Once you have the script above that uses WMI, you just need to find the
classes that have the properties you want. There are many examples in the
Script Center. For example, for memory and video:

http://www.microsoft.com/technet/scr...e/default.mspx

Network configuration info:

http://www.microsoft.com/technet/scr...t/default.mspx

Disks and volumes:

http://www.microsoft.com/technet/scr...s/default.mspx

The Win32_USBController class should help with USB ports. You can browse the
Script Center for ideas. Once you know the class, such as
Win32_ComputerSystem, you can search online for more information on the
properties exposed. For example, here is a hit for Win32_USBController:

http://www.microsoft.com/technet/scr...6/hey0208.mspx

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 07-22-2009   #5 (permalink)
steve


 
 

Re: Program to get hardware info?

Yes well thank you your program certainly seems thorough although I
really could not get it to run properly. It seemed to hang up along
the way. But there may be some things to pick out of it.

thanks.
My System SpecsSystem Spec
Old 07-22-2009   #6 (permalink)
steve


 
 

Re: Program to get hardware info?


Mayayana & Richard

Thanks there is a great deal of potential there. I was hoping which I
think you seem to be saying that it might be possible to simply add a
few more classes I may get close to what I need. I understand that
some data may be not available due to differences in MB 's etc. We
shall try and see what I can come up with.
Thanks all

My System SpecsSystem Spec
Old 07-29-2009   #7 (permalink)
Paul Randall


 
 

Re: Program to get hardware info?


"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
message news:udGIPhkCKHA.4608@xxxxxx
Quote:

>
> "steve" <stevesemple@xxxxxx> wrote in message
> news:dd2a86f0-7e78-4ebf-89c5-f329c08ca50d@xxxxxx
Quote:

>> I'm not a vbs script person I admit. I kind of poke around and glue a
>> few things together to get what I need.
>>
>> In this case I need a simple program that can print out basic info
>> about a computer so that we can paste it on top of the cases for a
>> quick summary of what is in the case.
>>
>> I found this nice little vbs script that does almost what I want.
>> However I want to add a few more features to it to give some
>> additional info.
>>
>> What is missing in it is ...
>>
>> I want the Name of the C drive (we actually give the drives a Serial
>> number that tells us the SN of the comptuer)
>>
>> I want the video card info basic model and info,
>>
>> I want the Nic info. eg what type of card it is so that we can know
>> what drivers it needs
>>
>> What USB ports are available,
>>
>> And I think finally the MB info that is what is the MB Mnf, and data
>> so that if we need drivers for it we can find them.
>>
>> The rest is covered by the program that I have edited.
>>
>> I have looked but I cant seem to find the information I need to edit
>> this file and give me the output I would like. Again Im just basic in
>> my scripting abilities.
>>
>> save and rename hardware.vbs
>> ----------------
>> '==========================================================================
>> '
>> ' NAME: <MemProcDiskInventory.vbs>
>> '
>> ' AUTHOR: Mark D. MacLachlan , ITSynergy
>> ' DATE : 5/15/2003
>> '
>> ' COMMENT: <Inventories computer configuration and writes report to
>> disk>
>> '==========================================================================
>> on error resume Next
>>
>> Set oShell = CreateObject("wscript.Shell")
>> Set env = oShell.environment("Process")
>> strComputer = env.Item("Computername")
>> Const HKEY_LOCAL_MACHINE = &H80000002
>> Const UnInstPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
>> \"
>> Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
>> ".\root\default:StdRegProv")
>>
>>
>> report = strComputer & " Computer Inventory" & vbCrLf &
>> "******************************************" & vbCrLf & vbCrLf
>> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
>> \cimv2")
>> Set colItems = objWMIService.ExecQuery("Select * from
>> Win32_OperatingSystem",,48)
>>
>> report = report & vbCrLf &
>> "******************************************" & vbCrLf
>> report = report & "OS Information" & vbCrLf &
>> "******************************************" & vbCrLf & vbCrLf
>> For Each objItem in colItems
>> report = report & strComputer & vbCrLf & "OS Details"& vbCrlf
>> report = report & "Caption: " & objItem.Caption & vbCrLf
>> report = report & "Description: " & objItem.Description & vbCrLf
>> report = report & "InstallDate: " & objItem.InstallDate & vbCrLf
>> report = report & "Manufacturer: " & objItem.Manufacturer &
>> vbCrLf
>> report = report & "Name: " & objItem.Name & vbCrLf
>> report = report & "Organization: " & objItem.Organization &
>> vbCrLf
>> report = report & "RegisteredUser: " & objItem.RegisteredUser &
>> vbCrLf
>> report = report & "SerialNumber: " & objItem.SerialNumber &
>> vbCrLf
>> report = report & "ServicePackMajorVersion: " &
>> objItem.ServicePackMajorVersion & vbCrLf
>> report = report & "ServicePackMinorVersion: " &
>> objItem.ServicePackMinorVersion & vbCrLf
>> report = report & "Version: " & objItem.Version & vbCrLf
>> Next
>>
>> Set colSettings = objWMIService.ExecQuery _
>> ("Select * from Win32_ComputerSystem")
>> report = report & vbCrLf &
>> "******************************************" & vbCrLf
>> report = report & "Memory and Processor Information" & vbCrLf &
>> "******************************************" & vbCrLf & vbCrLf
>> For Each objComputer in colSettings
>> report = report & objComputer.TotalPhysicalMemory /1024\1024+1 & "MB
>> Total memory" & vbcrlf
>> Next
>> Set colSettings = objWMIService.ExecQuery _
>> ("Select * from Win32_Processor")
>> For Each objProcessor in colSettings
>> report = report & objProcessor.Description & " Processor" & vbCrLf
>> Next
>>
>> report = report & vbCrLf &
>> "******************************************" & vbCrLf
>> report = report & "Disk Drive Information" & vbCrLf &
>> "******************************************" & vbCrLf & vbCrLf
>>
>> Set objWMIService = GetObject("winmgmts:")
>> Set objLogicalDisk = objWMIService.Get
>> ("Win32_LogicalDisk.DeviceID='c:'")
>> report = report & objLogicalDisk.FreeSpace /1024\1024+1 & "MB Free
>> Disk Space" & vbCrLf
>> report = report & objLogicalDisk.Size /1024\1024+1 & "MB Total Disk
>> Space" & vbCrLf
>>
>>
>> Set fso = CreateObject("Scripting.FileSystemObject")
>> Set ts = fso.CreateTextFile (strComputer & ".txt", ForWriting)
>> ts.write report
>> ts.write software
>> MsgBox Report
>> MsgBox "Done"
>>
>>
>
> Once you have the script above that uses WMI, you just need to find the
> classes that have the properties you want. There are many examples in the
> Script Center. For example, for memory and video:
>
> http://www.microsoft.com/technet/scr...e/default.mspx
>
> Network configuration info:
>
> http://www.microsoft.com/technet/scr...t/default.mspx
>
> Disks and volumes:
>
> http://www.microsoft.com/technet/scr...s/default.mspx
>
> The Win32_USBController class should help with USB ports. You can browse
> the Script Center for ideas. Once you know the class, such as
> Win32_ComputerSystem, you can search online for more information on the
> properties exposed. For example, here is a hit for Win32_USBController:
>
> http://www.microsoft.com/technet/scr...6/hey0208.mspx
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --

Hi,Richard
Do the links you posted give a more complete list of what info is actually
available on a specific computer than Scriptomatic gives? It is available
here:
http://www.microsoft.com/downloads/d...displaylang=en

It generates a script in your choice of VBScript, Perl, Python, or JScript,
that, I think, lists all available info for the various classes for the one
particular computer it is run on. By that, I mean that no matter what
version of WMI or what info the OEM has provided, the generated script is
basically a list of the property names that this computer's version of WMI
allows, and the output of the script is a list of values that the OEM or OS
has actually implimented. So I'm wondering if the links you give provide
ways to get additional information.

The generated VBScript uses a global On Error Resume Next statement to
suppress outputting property names for which no values are present, thus
reducing the amount of useless output.

-Paul Randall


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Can I get info on real, physical hardware ? Virtual PC
"This program cannot display the web page" in WMP11 Album Info? Software
New start program has been added, no info. on line General Discussion
Can't get rid of "Info Icon" pop-up "This program cannot display.. Vista General
Safely Remove Hardware program Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

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