@echo off :: Must be run as Administrator echo ============================================ echo Checking and Uninstalling WPS Office... echo ============================================ :: Search and uninstall WPS Office if found (like Control Panel) for /f "tokens=*" %%i in ('wmic product where "name like '%%WPS Office%%'" get name ^| findstr /i "WPS"') do ( echo Uninstalling: %%i wmic product where "name='%%i'" call uninstall /nointeractive ) :: Give some time to finish uninstall timeout /t 8 echo. echo ============================================ echo Blocking future WPS Office installation... echo ============================================ :: Disable Windows Installer (Optional, but helpful) REG ADD "HKLM\Software\Policies\Microsoft\Windows\Installer" /v DisableMSI /t REG_DWORD /d 1 /f :: Enable Software Restriction Policy REG ADD "HKLM\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers" /v PolicyScope /t REG_DWORD /d 0 /f REG ADD "HKLM\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers" /v TransparentEnabled /t REG_DWORD /d 1 /f REG ADD "HKLM\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers" /v Authenticaters /t REG_DWORD /d 1 /f REG ADD "HKLM\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers" /v DefaultLevel /t REG_DWORD /d 262144 /f :: Block the specific WPS install location REG ADD "HKLM\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Paths\{BlockWPS}" /v ItemData /t REG_SZ /d "C:\Program Files (x86)\Kingsoft\WPS Office\*" /f REG ADD "HKLM\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Paths\{BlockWPS}" /v SaferFlags /t REG_DWORD /d 0 /f REG ADD "HKLM\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Paths\{BlockWPS}" /v Description /t REG_SZ /d "Block WPS Office Install" /f REG ADD "HKLM\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Paths\{BlockWPS}" /v LastModified /t REG_BINARY /d 0000000000000000 /f echo. echo ============================================ echo Done. WPS Office removed and blocked. echo ============================================ pause