-
Notifications
You must be signed in to change notification settings - Fork 3
/
OpenWithSublime_uninstall.bat
35 lines (29 loc) · 1.04 KB
/
OpenWithSublime_uninstall.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
@echo off
SET elevate.CmdPath=%~dp0OpenWithSublime_elevate.cmd
call :check_Permissions
REM uninstall old version
SET entryName=Sublime
SET entryNameAsAdmin=Sublime As Admin
REG DELETE "HKEY_CLASSES_ROOT\*\shell\%entryName%" /f
REG DELETE "HKEY_CLASSES_ROOT\*\shell\%entryNameAsAdmin%" /f
REG DELETE "HKEY_CLASSES_ROOT\Folder\shell\%entryName%" /f
REM uninstall new version
SET entryName=Sublime Text
SET entryNameAsAdmin=Sublime Text As Admin
REG DELETE "HKEY_CLASSES_ROOT\*\shell\%entryName%" /f
REG DELETE "HKEY_CLASSES_ROOT\*\shell\%entryNameAsAdmin%" /f
REG DELETE "HKEY_CLASSES_ROOT\Folder\shell\%entryName%" /f
REG DELETE "HKEY_CLASSES_ROOT\Directory\Background\shell\%entryName%" /f
:check_Permissions
echo # Administrative permissions required. Detecting permissions...
net session >nul 2>&1
if %errorLevel% == 0 (
echo Administrative permissions confirmed.
goto :EOF
) else (
echo Failure: Current permissions inadequate. Try to get elevation...
SET openwithsublime_elevation=1
call "%elevate.CmdPath%" "%~fs0"
exit
)
goto :EOF