Avatar of John Anthony
John Anthony

asked on 

need a VB script to get details of all software installed in a machine add/remove program. put that details in excel or csv then mail it

need a VB script to get details of all software installed in a machine add/remove program. put that details in excel or csv then mail it
SoftwareVB Script

Avatar of undefined
Last Comment
Ryan Chong
SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of John Anthony
John Anthony

ASKER

thanks any vb script do we have
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

this vbscript code that found online is working fine for me.

you may need to customize it a little bit.

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile("software.csv", True)

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
  ("Select * from Win32_Product")

objTextFile.WriteLine "Caption" & vbtab & _
  "Description" & vbtab & "Identifying Number" & vbtab & _
  "Install Date" & vbtab & "Install Location" & vbtab & _
  "Install State" & vbtab & "Name" & vbtab & _ 
  "Package Cache" & vbtab & "SKU Number" & vbtab & "Vendor" & vbtab _
    & "Version" 

For Each objSoftware in colSoftware
  objTextFile.WriteLine objSoftware.Caption & vbtab & _
  objSoftware.Description & vbtab & _
  objSoftware.IdentifyingNumber & vbtab & _
  objSoftware.InstallDate2 & vbtab & _
  objSoftware.InstallLocation & vbtab & _
  objSoftware.InstallState & vbtab & _
  objSoftware.Name & vbtab & _
  objSoftware.PackageCache & vbtab & _
  objSoftware.SKUNumber & vbtab & _
  objSoftware.Vendor & vbtab & _
  objSoftware.Version
Next
objTextFile.Close

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of John Anthony
John Anthony

ASKER

thanks
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

so which solution are you using?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

just found that I got a typo in my comment:

try not using Powershell to archive that? which is pretty easy

suppose to be:

"try using .." or "why not using .."
Avatar of John Anthony
John Anthony

ASKER

How to email the excel file form powershell

Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

How to email the excel file form powershell

I would not want to discuss further since what you're asking is not really related to your original question, but in fact, it's pretty easy with Send-MailMessage method.

Send-MailMessage
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7
Software
Software

Software is any set of instructions that directs a computer to perform specific tasks or operations. Computer software consists of programs, libraries and related non-executable data (such as documentation). Computer software is non-tangible, contrasted with computer hardware, which is the physical component of computers. Software written in a machine language is known as "machine code". However, in practice, software is usually written in high-level programming languages than machine language. High-level languages are translated into machine language using a compiler or interpreter or a combination of the two.

43K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo