Skip to content

Instantly share code, notes, and snippets.

@uisuru
Created February 7, 2018 04:52
Show Gist options
  • Save uisuru/e1a89f6d401a3edbfaa7370b5ed562fb to your computer and use it in GitHub Desktop.
Save uisuru/e1a89f6d401a3edbfaa7370b5ed562fb to your computer and use it in GitHub Desktop.
Sublime Text 3 Context menu item deletion batch files with admin permission
@echo off
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit)
rem delete it for all file types
@reg delete "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /f
@reg delete "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /f
rem delete it for folders
@reg delete "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command" /f
@reg delete "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /f
rem delete it for folder background
@reg delete "HKEY_CLASSES_ROOT\Directory\Background\shell\Open with Sublime Text 3 Here\command" /f
@reg delete "HKEY_CLASSES_ROOT\Directory\Background\shell\Open with Sublime Text 3 Here" /f
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment