wmic product where "name like ‘test%%’" call uninstall /nointeractive

Home Forums Scripting DOS Command Shell wmic product where "name like ‘test%%’" call uninstall /nointeractive

This topic contains 1 reply, has 2 voices, and was last updated by Avatar erangi 4 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Avatar
    APOC
    Member
    #161926

    I run this script to remove old “crap” (then deploy the newest version with GPO):
    @echo OFF
    SETLOCAL ENABLEEXTENSIONS
    REM SETLOCAL ENABLEDELAYEDEXPANSION
    CLS
    echo.uninstall (old/previous) Adobe ShockWave/Flash…

    CALL “\dc01.lksvdd.localnetlogonLog_management.bat” >nul 2>&1

    :: RUN_Once
    IF NOT EXIST “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” (GOTO Uninstall_Adobe-Addons) ELSE GOTO:EOF
    GOTO:EXIT

    :Uninstall_Adobe-Addons
    rem uninstall old adobe shockwave/flash installations; new adobe shockwave/flash setup pushed with GPO…

    REM wmic product where “name like ‘Adobe Flash Player 11%%'” call uninstall /nointeractive > “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1
    wmic product where “name like ‘Adobe Flash Player 10%%'” call uninstall /nointeractive > “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1
    REM wmic product where “name like ‘Adobe Shockwave Player 12%%'” call uninstall /nointeractive >> “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1
    wmic product where “name like ‘Adobe Shockwave Player 11%%'” call uninstall /nointeractive >> “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1
    wmic product where “name like ‘Adobe Shockwave Player 11._'” call uninstall /nointeractive >> “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1

    rem Abort possible ShutDown………………
    “%windir%system32shutdown.exe” /a >nul 2>&1

    :EXIT
    ECHO #runTimeStamp -4- “uninstall_adobe-addons.cmd” [%DATE% %TIME%] EOF >> “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1

    rem PAUSE
    ENDLOCAL
    GOTO:EOF[/CODE]This does work for the old/previous flashplayers, but [U]doesn’t[/U][B]?[/B] work for the shockwave player…these do not get removed and I can’t figure out why. The name is correct it’s the same as stated in “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall” or “HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall”

    [B]=> [/B]the batch file (.cmd) is run from GPO[B]:[/B] Comp.Config-Policies-Admin.Templ.-System-Logon-Run these programs at user logon-Enabled[B]:[/B][I]uninstall_stuff.cmd[/I]

    [B]PS.[/B]
    AND I’ve got 5 Win8x64PRO workstations which give some of this results in the log[B]:[/B] [COLOR=”Red”]ReturnValue = [U]1603[/U];[/COLOR]
    Then it wasn’t run with admin privileges? (at least I did find such results with Google) BUT that’s kinda weird imo I did tweak UAC (comp.config) with GPO[B]:[/B]
    [I]User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode Elevate without prompting
    User Account Control: Detect application installations and prompt for elevation Disabled
    User Account Control: Only elevate UIAccess applications that are installed in secure locations Disabled [/I]
    OR did I miss out on something[B]?[/B] (and the users where this happens are also in the windows administrators group)[CODE]@ECHO OFF
    SETLOCAL ENABLEEXTENSIONS
    REM SETLOCAL ENABLEDELAYEDEXPANSION
    CLS
    echo.uninstall (old/previous) Adobe ShockWave/Flash…

    CALL “\dc01.lksvdd.localnetlogonLog_management.bat” >nul 2>&1

    :: RUN_Once
    IF NOT EXIST “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” (GOTO Uninstall_Adobe-Addons) ELSE GOTO:EOF
    GOTO:EXIT

    :Uninstall_Adobe-Addons
    rem uninstall old adobe shockwave/flash installations; new adobe shockwave/flash setup pushed with GPO…

    REM wmic product where “name like ‘Adobe Flash Player 11%%'” call uninstall /nointeractive > “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1
    wmic product where “name like ‘Adobe Flash Player 10%%'” call uninstall /nointeractive > “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1
    REM wmic product where “name like ‘Adobe Shockwave Player 12%%'” call uninstall /nointeractive >> “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1
    wmic product where “name like ‘Adobe Shockwave Player 11%%'” call uninstall /nointeractive >> “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1
    wmic product where “name like ‘Adobe Shockwave Player 11._'” call uninstall /nointeractive >> “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1

    rem Abort possible ShutDown………………
    “%windir%system32shutdown.exe” /a >nul 2>&1

    :EXIT
    ECHO #runTimeStamp -4- “uninstall_adobe-addons.cmd” [%DATE% %TIME%] EOF >> “%systemroot%LOGSLKSVDDTimuninstall_(shockwave)flash_12+11.txt” 2>&1

    rem PAUSE
    ENDLOCAL
    GOTO:EOF[/CODE]This does work for the old/previous flashplayers, but doesn’t? work for the shockwave player…these do not get removed and I can’t figure out why. The name is correct it’s the same as stated in “HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall” or “HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall”

    => the batch file (.cmd) is run from GPO: Comp.Config-Policies-Admin.Templ.-System-Logon-Run these programs at user logon-Enabled:uninstall_stuff.cmd

    PS.
    AND I’ve got 5 Win8x64PRO workstations which give some of this results in the log: ReturnValue = 1603;
    Then it wasn’t run with admin privileges? (at least I did find such results with Google) BUT that’s kinda weird imo I did tweak UAC (comp.config) with GPO:
    User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode Elevate without prompting
    User Account Control: Detect application installations and prompt for elevation Disabled
    User Account Control: Only elevate UIAccess applications that are installed in secure locations Disabled

    OR did I miss out on something? (and the users where this happens are also in the windows administrators group)

    Avatar
    erangi
    Member
    #391092

    I know this is an old post, but I just had this same issue with uninstalling Shockwave via wmic. I ended up using “caption” instead of “name”. That did the trick.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.