VBS Script To Send Add And Remove Applications For A remote Machine To Excel

 

This VBS script will take a remote machine name from an input dialog box and write the following information to an excel spreadsheet for each listed item in the remote machines add and remove applications program group.

 

Machine Name

Display Name

Product ID

Publisher

Version

 

VBS Script:

 

strComputer = InputBox ("Enter Machine Name")

 

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

intRow = 2

 

objExcel.Cells(1, 2).Value = "Machine Name"

objExcel.Cells(1, 2).Value = "Display Name"

objExcel.Cells(1, 3).Value = "Product ID"

objExcel.Cells(1, 4).Value = "Publisher"

objExcel.Cells(1, 5).Value = "Version"

 

 

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32Reg_AddRemovePrograms")

For Each objItem in colItems

 

objExcel.Cells(intRow, 1).Value = UCase(strComputer)

objExcel.Cells(intRow, 2).Value = objItem.DisplayName

objExcel.Cells(intRow, 3).Value = objItem.ProdID

objExcel.Cells(intRow, 4).Value = objItem.Publisher

objExcel.Cells(intRow, 5).Value = objItem.Version

 

intRow = intRow + 1

Next

 

objExcel.Range("A1:E1").Select

objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit

 

MsgBox "Done"

 

 

 

Published Sunday, June 22, 2008 1:05 PM by dhite
Filed under:

Comments

# VBS Script To Send Add And Remove Applications For A remote … - Learn Excel

Pingback from  VBS Script To Send Add And Remove Applications For A remote … - Learn Excel