@ECHO OFF&PUSHD %~DP0 &TITLE 绿化和选项
mode con cols=36 lines=20
color 2F
Rd "%WinDir%\system32\test_permissions" >NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行！&&PAUSE >NUL&&EXIT)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion
:Menu
Cls
@ echo.
@ echo.　　　　　 菜 单 选 项
@ echo.
@ echo.     绿化[必须] → 请输入1
@ echo.
@ echo.     创建桌面图标 → 请输入2
@ echo.
@ echo.     卸载 → 请输入3
@ echo.
set /p xj= 输入数字按回车：
if /i "%xj%"=="1" Goto Install
if /i "%xj%"=="2" Goto Establish
if /i "%xj%"=="3" Goto Uninstall
@ echo.
echo      选择无效，请重新输入
ping -n 2 127.1>nul 
goto menu
:Install
@ echo.
ECHO 　　　正在安装中..请稍等..
taskkill /f /im et*>NUL 2>NUL
taskkill /f /im wpp*>NUL 2>NUL
taskkill /f /im wps*>NUL 2>NUL
taskkill /f /im qingbangong.exe>NUL 2>NUL
cd office6
ksomisc.exe -register
ksomisc.exe -reg_kso
ksomisc.exe -reg_kde
ksomisc.exe -reg_wps
ksomisc.exe -reg_wpp
ksomisc.exe -reg_et
ksomisc.exe -regksee
ksomisc.exe -regmtfont
ksomisc.exe -rename 2052 install
ksomisc.exe -Assoword
ksomisc.exe -Assoexcel
ksomisc.exe -Assopowerpnt
ksomisc.exe -compatiblemso
ksomisc.exe -saveas_mso
ksomisc.exe -rebuildicon
reg delete HKCU\Software\Kingsoft\Office /F>NUL2>NUL
reg add HKCR\.doc\WPS.Doc.6\ShellNew /v FileName /d "%cd%\mui\zh_CN\templates\newfile.wps" /F>NUL2>NUL
reg add HKCR\.docx\WPS.Docx.6\ShellNew /v "FileName" /d "%cd%\mui\zh_CN\templates\newfile.wps" /F>NUL2>NUL
reg add HKCR\.ppt\WPP.PPT.6\ShellNew /v "FileName" /d "%cd%\mui\zh_CN\templates\newfile.dps" /F>NUL2>NUL
reg add HKCR\.pptx\WPP.PPTX.6\ShellNew /v "FileName" /d "%cd%\mui\zh_CN\templates\newfile.pptx" /F>NUL2>NUL
reg add HKCR\.xls\ET.Xls.6\ShellNew /v "FileName" /d "%cd%\mui\zh_CN\templates\newfile.et" /F>NUL2>NUL
reg add HKCR\.xlsx\ET.Xlsx.6\ShellNew /v "FileName" /d "%cd%\mui\zh_CN\templates\newfile.xlsx" /F>NUL2>NUL
reg add HKCR\.xlsm\ET.Xlsm.6\ShellNew /v "FileName" /d "%cd%\mui\zh_CN\templates\newfile.xlsx" /F>NUL2>NUL
reg add HKCU\Software\Kingsoft\wpscloud /v "LibPath" /d "%~dp0office6/addons//qing/qingbangong.dll" /F>NUL2>NUL
reg add HKCU\Software\Kingsoft\Office\6.0\et /v "uifile" /d "res/etongmani.kui" /F>NUL2>NUL
reg add HKCU\Software\Kingsoft\Office\6.0\wps /v "uifile" /d "res/wpsongmani.kui" /F>NUL2>NUL
reg add HKCU\Software\Kingsoft\Office\6.0\wpp /v "uifile" /d "res/wppongmani.kui" /F>NUL2>NUL
reg add HKCU\Software\Kingsoft\Office\6.0\common /v "InstallRoot" /d "%~dp0\" /F>NUL2>NUL
rd/s/q "%AppData%\Kingsoft\office6"2>NUL
rd/s/q "%AppData%\Kingsoft\wps"2>NUL
goto Install2
:Establish
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\WPS表格.lnk""):b.TargetPath=""%~dp0office6\et.exe"":b.WorkingDirectory=""%~dp0office6"":b.Save:close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\WPS演示.lnk""):b.TargetPath=""%~dp0office6\wpp.exe"":b.WorkingDirectory=""%~dp0office6"":b.Save:close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\WPS文字.lnk""):b.TargetPath=""%~dp0office6\wps.exe"":b.WorkingDirectory=""%~dp0office6"":b.Save:close")
goto fanhui
:Uninstall
@ echo.
echo 　　　正在卸载中..请稍等..
taskkill /f /im et*>NUL 2>NUL
taskkill /f /im wpp*>NUL 2>NUL
taskkill /f /im wps*>NUL 2>NUL
cd office6
ksomisc.exe -deletelinkex desktop 2052
ksomisc.exe -rename 2052 uninstall
ksomisc.exe -unassoword
ksomisc.exe -unassopowerpnt
ksomisc.exe -unassoexcel
ksomisc.exe -unregister
ksomisc.exe -unregmtfont
ksomisc.exe -rebuildicon
reg delete HKCR\.doc\WPS.Doc.6 /F>NUL2>NUL
reg delete HKCR\.docx\WPS.Docx.6 /F>NUL2>NUL
reg delete HKCR\.ppt\WPP.PPT.6 /F>NUL2>NUL
reg delete HKCR\.pptx\WPP.PPTX.6 /F>NUL2>NUL
reg delete HKCR\.xls\ET.Xls.6 /F>NUL2>NUL
reg delete HKCR\.xlsx\ET.Xlsx.6 /F>NUL2>NUL
reg delete HKCR\.xlsm\ET.Xlsm.6 /F>NUL2>NUL
reg delete HKCU\Software\Kingsoft\Office /F>NUL2>NUL
rd/s/q "%AppData%\Kingsoft\office6"2>NUL
rd/s/q "%AppData%\Kingsoft\wps"2>NUL
del /f /q "%userprofile%"\Desktop\WPS表格.lnk
del /f /q "%userprofile%"\Desktop\WPS演示.lnk
del /f /q "%userprofile%"\Desktop\WPS文字.lnk
del /f /q "%userprofile%"\桌面\WPS表格.lnk
del /f /q "%userprofile%"\桌面\WPS演示.lnk
del /f /q "%userprofile%"\桌面\WPS文字.lnk
goto Uninstall2
:fanhui
@ ECHO.
ECHO 　　　设置完成..
ping -n 2 127.8>nul
goto menu
:Install2
@ ECHO.
ECHO 　　　安装完成..
ping -n 2 127.8>nul
goto menu
:Uninstall2
@ ECHO.
ECHO 　　　卸载完成..
ping -n 2 127.8>nul
goto menu
