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