-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWin11改用传统右键菜单.bat
42 lines (37 loc) · 1.22 KB
/
Win11改用传统右键菜单.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
@echo off
echo.
echo =============================================
echo 右键菜单类型
echo 1 (Win10旧版右键菜单)
echo 2 (Win11新版右键菜单)
echo =============================================
:select
set /p opt=请选择操作:
if %opt%==1 (
echo 正在开启Win10旧版右键菜单》》》》》》》》》
reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
)
if %opt%==2 (
echo 正在恢复Win11新版右键菜单》》》》》》》》》
reg delete "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" /f
)
@echo off
echo *************************************
echo * *
echo * 重启任务管理器... *
echo * *
echo *************************************
taskkill /f /im explorer.exe & start explorer.exe
pause