Forum Discussion
Hi,
anyone have got other ideas?
I can check the processes related to the application (as mattb explain) but this check is currently not enough, I would like to find a way to check if the application appears within the "Program and Feature" list.
Thanks
Simona
Hi Simona,
This is also an option using powershell script, but check the feasibility from your end
****************** Test Complete Code***************************************
function CheckProgramInstalled()
{
var WSH = Sys["OleObject"]("WScript.Shell");
var objExec = WSH["Exec"]("powershell -file C:\\****\\PowerscriptName.ps1");
objExec ["StdIn"]["Close"]();
var strOutput = objExec ["StdOut"]["ReadAll"]();
Log["Message"](strOutput);
}
****************** Test Complete Code***************************************
in the above code power script(PS1 file - C:\\****\\PowerscriptName.ps1) is being used, you could create that file with below code using node pad and save as .ps1 extension or using powershell ise or VS CODE
$software = "PROGRAM NAME THAT YOU ARE SEARCHING";
$installed = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where { $_.DisplayName -eq $software }) -ne $null
If(-Not $installed) {
Write-Host "'$software' is not installed";
} else {
Write-Host "'$software' is installed."
}
It works if machine is 64 bit
Else you can check using below in 2nd line of powershell script - I have not tried this
HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstal in 2nd line of powershell script
Related Content
Recent Discussions
- 22 hours agoGane195