Skip to content

Instantly share code, notes, and snippets.

@mark05e
Created July 13, 2019 05:50
Show Gist options
  • Save mark05e/ef6d488dc9efa2b2c83bc5063cb1b57d to your computer and use it in GitHub Desktop.
Save mark05e/ef6d488dc9efa2b2c83bc5063cb1b57d to your computer and use it in GitHub Desktop.
Uninstall Screen Capture software - Avaya Contact Recorder
:: UNINSTALL SCREEN CAPTURE (AVAYA CONTACT RECORDER)
:: AUTHOR: MARK
:: MODDED FROM: https://community.spiceworks.com/topic/2143980-deploy-or-upgrade-java-8-via-shutdown-script-remove-old-javas
:: It extracts software software GUID, then use the GUID to search the name and version
@echo off
setlocal ENABLEDELAYEDEXPANSION
set SoftwareName=Screen Capture Module
set x86GUID=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
set x64GUID=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
for /f "delims=" %%P in ('reg query "%x86GUID%" /s /f "%SoftwareName%" 2^>nul ^| findstr "HKEY_LOCAL_MACHINE"') do (
echo Found %SoftwareName% at registry path: %%P
for /f "tokens=2*" %%A in ('reg query "%%P" /v "DisplayVersion" 2^>nul ^|findstr "DisplayVersion"') do echo Software Version: %%B
for /f "tokens=2*" %%A in ('reg query "%%P" /v "UninstallString" 2^>nul ^|findstr "UninstallString"') do (
echo PRESS ANY KEY TO UNINSTALL ...
PAUSE
echo %%B | findstr /c:"MsiExec.exe" >nul && (
set MsiStr=%%B
set MsiStr=!MsiStr:/I=/X!
echo !MsiStr! /quiet /norestart
!MsiStr! /quiet /norestart
timeout 5
) || (
echo No Uninstall String for MsiExec %%B
timeout 5
)
)
)
if not defined MsiStr (
COLOR 0c
echo %SoftwareName% not found, install it?
timeout 2
COLOR
)
endlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment