VB Script and Computer Inventory   Leave a comment

http://www.robvanderwoude.com/vbstech_inventory_msinfo.html

Option Explicit

‘ Create a full MSInfo report of the local
‘ computer, and save it as C:\msinforeport.txt
MSInfo “.”, “C:\msinforeport.txt”, True

Sub MSInfo( myComputer, myReportFile, blnFullReport )
‘ This subroutine generates an MSInfo report for the specified
‘ computer, saving it under the specified file name.

‘ Arguments:
‘ myComputer [string] the computer to be queried, or a dot
‘ or empty string for the local computer
‘ myReportFile [string] the file name of the report to be generated
‘ blnFullReport [boolean] if True, a full report will be generated,
‘ otherwise only an OS summary is generated

‘ Returns:
‘ A full MSInfo report file for the specified computer

‘ Written by Rob van der Woude
http://www.robvanderwoude.com

Dim objMSInfo, strCategory, varPctDone, wshShell

If myComputer = “” Or myComputer = “.” Then
‘ Get the computer name of the local computer
Set wshShell = CreateObject( “WScript.Shell” )
myComputer = wshShell.ExpandEnvironmentStrings( “%ComputerName%” )
Set wshShell = Nothing
End If

If blnFullReport = True Then
strCategory = “”
Else
strCategory = 0
End If

‘ Query the computer and generate the report
Set objMSInfo = CreateObject( “Msinfo32.MSInfo.1” )
objMSInfo.UpdateDCOProgress( varPctDone )
objMSInfo.SaveFile myReportFile, myComputer, strCategory
Set objMSInfo = Nothing
End Sub

Advertisements

Posted February 25, 2008 by mmdmurphy in freeware, tips, windows

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: