Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Thursday, 22 December 2022

PowerShell: Universal Uninstaller (Script to fetch the uninstall string of all the installed apps)

There are multiple ways to get the installed apps removed from the device. This script particularly helps to find the uninstall string of all the installed apps from the registry, which include MSI, and EXE. The administrator can run this and choose the specific application to uninstall it.

Script:

$64apps=Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate, UninstallString, InstallLocation

$32apps=Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate, UninstallString, InstallLocation

$allinstalledapps = $64apps + $32apps

$RUninst=$allinstalledapps| Out-GridView -Title "Select Application to Uninstall" –PassThru | Select-Object -ExpandProperty UninstallString

if($RUninst)

{

foreach ($Run in $RUninst)

{

&cmd /c $Run

}

}

else

{

Get-Package -ProviderName msi -AllVersions| Out-GridView -Title "Select Application to Uninstall" –PassThru | Uninstall-Package -Confirm

}


Steps To Do:
1. Copy the code and save the script as XXX.PS1

2. Set the execution policy to run the script.

3. Execute the script as administrator and it will display the details in Grid view.

4. Select an app that has the uninstall string and click "ok" to proceed with uninstall.

5. Proceed with the next steps to uninstall the selected app.


Note: If there is no Uninstall String visible for an app, upon selecting that app will show you another grid view, where you can select and uninstall the app using the default PowerShell "Get-package" method.


Friday, 2 March 2018

Tips: Hide installation progress from Windwos TaskBar

Sometimes will face these kind of issue.
Scenario:
When installing an EXE application with silent parameters using VB script,  it normally hides the UI but sometimes we use to see the application progress bar icon visible in task bar. the issue begins here and there is possibility, user may can cancel the installation.

Example
User may right click the icon and click close window option will lead to the installation get failed. 



 

Solution

 
Make the Windows Style value as "0" - Hidden, to get resolved from the issue. During installation it will hide the progress bar icon from task bar.

       Set oShell = CreateObject("WScript.Shell")
    oShell.Run"C:\Users\Administrator\Desktop\TEST.exe",0,True