@echo off
taskkill /f /im wps* /t 2>nul
taskkill /f /im wpp.exe /t 2>nul
taskkill /f /im et.exe /t 2>nul


cd /d "%~dp0"

title 更改皮肤颜色greeny
reg import "%~dp0mdbx\中灰.reg"
reg delete "HKCU\Software\Kingsoft\Office\6.0\plugins\kskincenter" /f /v "skinlistmd5" 2>nul
reg add "HKCU\SOFTWARE\Kingsoft\Office\6.0\plugins\kskincenter\users\default\wpsoffice" /f /v "lastSkin" /t REG_SZ /d "2019dark"
::不自动切换皮肤
reg add "HKCU\SOFTWARE\Kingsoft\Office\6.0\Common" /f /v "autoSwitchSkin" /t REG_SZ /d "false"


del /s /q "%~dp0office6\skins\2019dark" >nul
del /s /q "%appdata%\Kingsoft\office6\cache" >nul

xcopy /s /y "%~dp0office6\skins\2019greeny" "%~dp0office6\skins\2019dark\" >nul

set "tpn=%appdata%\Kingsoft\wps\addons\data\win-i386\kconfigcenter\kccsdkdb\kccsdkpriortydb\mdbx.dat"
if not exist "%appdata%\Kingsoft\wps\addons\data\win-i386\kconfigcenter\kccsdkdb\kccsdkpriortydb" md "%appdata%\Kingsoft\wps\addons\data\win-i386\kconfigcenter\kccsdkdb\kccsdkpriortydb"
copy /y "%~dp0mdbx\mdbx-中灰.dat" "%tpn%"

