Announcement

Collapse
No announcement yet.

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

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • wmic product where "name like 'test%%'" call uninstall /nointeractive

    I run this script to remove old "crap" (then deploy the newest version with GPO):
    Code:
    @ECHO OFF
    SETLOCAL ENABLEEXTENSIONS
    REM SETLOCAL ENABLEDELAYEDEXPANSION
    CLS
    echo.uninstall (old/previous) Adobe ShockWave/Flash...
    
    CALL "\\dc01.lksvdd.local\netlogon\Log_management.bat" >nul 2>&1
    
    :: RUN_Once
    IF NOT EXIST "%systemroot%\LOGS\LKSVDD\Tim\uninstall_(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%\LOGS\LKSVDD\Tim\uninstall_(shockwave)flash_12+11.txt" 2>&1
    wmic product where "name like 'Adobe Flash Player 10%%'" call uninstall /nointeractive          > "%systemroot%\LOGS\LKSVDD\Tim\uninstall_(shockwave)flash_12+11.txt" 2>&1
    REM wmic product where "name like 'Adobe Shockwave Player 12%%'" call uninstall /nointeractive >> "%systemroot%\LOGS\LKSVDD\Tim\uninstall_(shockwave)flash_12+11.txt" 2>&1
    wmic product where "name like 'Adobe Shockwave Player 11%%'" call uninstall /nointeractive     >> "%systemroot%\LOGS\LKSVDD\Tim\uninstall_(shockwave)flash_12+11.txt" 2>&1
    wmic product where "name like 'Adobe Shockwave Player 11._'" call uninstall /nointeractive     >> "%systemroot%\LOGS\LKSVDD\Tim\uninstall_(shockwave)flash_12+11.txt" 2>&1
    
    rem Abort possible ShutDown..................
    "%windir%\system32\shutdown.exe" /a >nul 2>&1
    
    
    :EXIT
    ECHO #runTimeStamp -4- "uninstall_adobe-addons.cmd" [%DATE% %TIME%] EOF >> "%systemroot%\LOGS\LKSVDD\Tim\uninstall_(shockwave)flash_12+11.txt" 2>&1
    
    
    rem PAUSE
    ENDLOCAL
    GOTO:EOF
    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_MACHINE\SOFTWARE\Microsoft\Windows\Cur rentVersion\Uninstall" or "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft \Windows\CurrentVersion\Uninstall"

    => 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)
    Last edited by APOC; 17th July 2013, 12:39. Reason: added: PS. W8 etc.

  • #2
    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.

    Comment

    Working...
    X