@echo off
taskkill /f /im wps.exe /t
taskkill /f /im wpscloudsvr.exe /t
taskkill /f /im wpp.exe /t
taskkill /f /im et.exe /t

for /f "tokens=*" %%a in ('dir /b /s /ad "%appdata%\Kingsoft"') do rd /s /q "%%a"


md "%AppData%\Kingsoft\office6" 2>NUL
md "%AppData%\Kingsoft\office6\customui" 2>NUL
cd /d "%AppData%\Kingsoft\office6\customui" 2>NUL
echo [common]>ui.ini 2>NUL
echo qatUsed=true>>ui.ini 2>NUL
md "%LocalAppData%\Kingsoft\WPS Cloud Files\userdata\qing" 2>NUL
cd /d "%LocalAppData%\Kingsoft\WPS Cloud Files\userdata\qing" 2>NUL
echo [General]>config.ini 2>NUL
echo autologin=1 >>config.ini 2>NUL

cd /d "%~dp0"
::---文件-选项=自定义功能区-安全---复选框选择打开或关闭---------------------------------------------------
if exist utility\customui xcopy /s /q /y /r utility\customui "%appdata%\Kingsoft\office6\customui\"

::-------------------------最大化--------------------------------------------------------------------------------------------
reg add "HKCU\Software\Kingsoft\Office\6.0\et\Application Settings" /f /v "WindowIsMaximized" /t REG_SZ /d "true"
reg add "HKCU\Software\Kingsoft\Office\6.0\wpp\Application Settings" /f /v "WindowIsMaximized" /t REG_SZ /d "true"
reg add "HKCU\Software\Kingsoft\Office\6.0\wps\Application Settings" /f /v "WindowIsMaximized" /t REG_SZ /d "true"


::-------------------------common-------------------------------------------------------------------------
reg add "HKCU\Software\Kingsoft\Office" /f /v "languages" /t REG_SZ /d "zh_CN"
reg add "HKCU\SOFTWARE\Kingsoft\Office\6.0\Common" /f /v "AcceptedEULA" /t REG_SZ /d "true"
reg add "HKCU\SOFTWARE\Kingsoft\Office\6.0\Common" /f /v "category" /t REG_SZ /d "personal"
reg add "HKCU\Software\Kingsoft\Office\6.0\common" /f /v "DefaultLanguage" /t REG_DWORD /d 2052
reg add "HKCU\Software\Kingsoft\Office\6.0\common\Local" /f /v "UILanguage" /t REG_DWORD /d 2052

reg add "HKCU\SOFTWARE\Kingsoft\Office\6.0\Common" /f /v "do_not_detect_file_association_while_startup" /t REG_SZ /d "true"
reg add "HKCU\SOFTWARE\Kingsoft\Office\6.0\Common\updateinfo" /f /v "ForceUpdateOnStart" /t REG_SZ /d "false"

	
::----------------写入注册信息，以取消首次启动时的对话框-------------------------------------------------------------------------------------------------
reg add "HKLM\SOFTWARE\WOW6432Node\Kingsoft\Office\6.0\Common" /f /v "hostprocname" /t REG_SZ /d "wpsoffice.exe"
Reg add "HKLM\SOFTWARE\WOW6432Node\Kingsoft\Office\6.0\Common" /f /v "do_not_detect_file_association_while_startup" /t REG_SZ /d "true"


start "" "%appdata%\Kingsoft"