All gists

Last active 5 months ago
0 0 1
1 # WPS Office 2023/2019 专业增强版安装工具 - 最终完整修复版
2 # 彻底解决空值错误和路径查找问题
3 # 编码格式: UTF-8 with BOM
4
5 # 要求管理员权限
6 if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
7 Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
8 exit
9 }
Last active 5 months ago
0 0 1
1 # 第一部分:初始化和管理员检查
2 # 添加必要的程序集
3 Add-Type -AssemblyName PresentationFramework
4 Add-Type -AssemblyName System.Windows.Forms
5 Add-Type -AssemblyName PresentationCore
6
7 # 检查管理员权限
8 if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
9 Write-Host "需要管理员权限运行此脚本!" -ForegroundColor Red
10 $result = [System.Windows.MessageBox]::Show("此工具需要管理员权限才能执行分区操作。是否以管理员身份重新启动?", "需要管理员权限", [System.Windows.MessageBoxButton]::YesNo, [System.Windows.MessageBoxImage]::Warning)
Last active 5 months ago
0 0 1
1 @echo off
2 taskkill /im DrvCeo.exe /f /t
3 for /f "tokens=3,*" %%i in ('reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Common Desktop"') do (set desk=%%j)
4 for /f "tokens=3,*" %%i in ('reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Common Programs"') do (set pro=%%j)
5 del /s /q /f "%desk%\驱动总裁网卡版.lnk"
6 del /s /q /f "%desk%\驅動總裁網卡版.lnk"
7 del /s /q /f "%desk%\DrvCeonetcard.lnk"
8 del /s /q /f "%desk%\驱动总裁.lnk"
9 del /s /q /f "%desk%\驅動總裁.lnk"
10 del /s /q /f "%desk%\DrvCeo.lnk"