Cool Solutions

(GroupWise) uninstall script

eradke

By:

June 6, 2013 9:20 am

Reads: 25

Comments:1

License:
AS-IS

A powerful Windows CMD script that query’s WMI for MSI package names containing the string stored in variable ‘__FILTER’.
Then, it performs a silent uninstall of any packages that it finds a match.

I developed it to remove Groupwise Clients (those that utilize MSI) which were installed with all different configurations throughout the enterprise. Most everyone was on GW802.

I am submitting this as a GW removal tool, but really, you could use this code to query any string to uninstall any product.

Call it as a function from a for loop to perform different query’s etc . . .

Hope someone can find a good home for it.

@echo off
REM Written by Ed Radke DTS/Corrections
REM Script query's WMI for MSI packages names containing the string stored in variable '__FILTER'.
REM Then, it performs a silent uninstall of any packages that it finds a match.

REM A string that will be searched for in the product name to be uninstalled.
REM BE CAUTIOUS WHAT YOU TYPE HERE.
REM too broad of a query could render your system useless.
REM If you're not sure try this wmic command alone to see what it returns:::
REM wmic product where (name like "%PUT_YOUR_STRING_HERE%") get name,packagecache /format:csv

set __FILTER=groupwise

REM Output of wmic
set __OUT=%TEMP%\WMIC_GW.TXT

REM Uninstall Log file
SET __LOG=C:\gw_remove.txt

REM Remove output if it exists
if exist "%__OUT%" del /f /q "%__OUT%" >NUL 2>&1

echo Initializing

REM search for MSI product's local package
wmic /output:"%__OUT%" product where (name like "%%%__FILTER%%%") get name,packagecache /format:csv

REM Output is unicode, convert to ANSI
type "%__OUT%" >"%__OUT%.tmp"
type "%__OUT%.tmp" >"%__OUT%"

REM Perform uninstall, reboot is suppressed
for /f "usebackq tokens=2,3 skip=2 delims=," %%A in ("%__OUT%") do (
echo Un-installing "%%A"
msiexec.exe /x "%%B" /qn /l*v "%__LOG%" REBOOT=REALLYSUPPRESS
)
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: , ,
Categories: Cool Tools, GroupWise, Technical

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

1 Comment

  1. By:spgsitsupport

    Not everybody lives in US, so with Windows 7 bug it needs to be:

    /format:”%WINDIR%\System32\wbem\en-us\csv”

    as per: http://stackoverflow.com/questions/9673057/wmic-error-invalid-xsl-format-in-windows7

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)

Comment

RSS