Skip to content

Instantly share code, notes, and snippets.

@OneNiNE87
Last active October 25, 2025 00:57
Show Gist options
  • Save OneNiNE87/acbb166362b2b04350e64938586d525d to your computer and use it in GitHub Desktop.
Save OneNiNE87/acbb166362b2b04350e64938586d525d to your computer and use it in GitHub Desktop.
My Context Menu Customizations for Windows11
Windows Registry Editor Version 5.00
; ==========================================================
; === CLEANUP: Remove old Sublime Text and Take Ownership entries ===
; ==========================================================
[-HKEY_CLASSES_ROOT\Directory\background\shell\Open with &SublimeText]
[-HKEY_CURRENT_USER\Software\Classes\*\shell\Open with &Sublime]
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &Sublime]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &Sublime]
[-HKEY_CURRENT_USER\Software\Classes\Applications\sublime_text.exe\shell\open]
[-HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
[-HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\TakeOwnership]
; ==========================================================
; === Open with Sublime Text (fixed, unified) ===
; ==========================================================
; For all files
[HKEY_CLASSES_ROOT\*\shell\Open with &SublimeText]
@="Open with &SublimeText"
"Icon"="C:\\SublimeText\\sublime_text.exe"
[HKEY_CLASSES_ROOT\*\shell\Open with &SublimeText\command]
@="\"C:\\SublimeText\\sublime_text.exe\" \"%1\""
; For folders
[HKEY_CLASSES_ROOT\Directory\shell\Open with &SublimeText]
@="Open with &SublimeText"
"Icon"="C:\\SublimeText\\sublime_text.exe"
[HKEY_CLASSES_ROOT\Directory\shell\Open with &SublimeText\command]
@="\"C:\\SublimeText\\sublime_text.exe\" \"%1\""
; For folder background
[HKEY_CLASSES_ROOT\Directory\Background\shell\Open with &SublimeText]
@="Open with &SublimeText"
"Icon"="C:\\SublimeText\\sublime_text.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Open with &SublimeText\command]
@="\"C:\\SublimeText\\sublime_text.exe\" \"%V\""
; ==========================================================
; === Move to New Folder ===
; ==========================================================
[HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\MoveTo]
@="Move to New Folder"
"Icon"="shell32.dll,-319"
[HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\MoveTo\command]
@="cmd.exe /c if not exist \"%1\\..\\New Folder\" mkdir \"%1\\..\\New Folder\" & move \"%1\" \"%1\\..\\New Folder\""
; ==========================================================
; === Take Ownership (elevated automatically) ===
; ==========================================================
; For files
[HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
@="Take Ownership"
"Icon"="shell32.dll,69"
[HKEY_CLASSES_ROOT\*\shell\TakeOwnership\command]
@="powershell -Command Start-Process cmd -ArgumentList '/c takeown /F \"%1\" /R /D Y && icacls \"%1\" /grant administrators:F & pause' -Verb RunAs"
; For folders
[HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership]
@="Take Ownership"
"Icon"="shell32.dll,69"
[HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership\command]
@="powershell -Command Start-Process cmd -ArgumentList '/c takeown /F \"%1\" /R /D Y && icacls \"%1\" /grant administrators:F & pause' -Verb RunAs"
; For folder background
[HKEY_CLASSES_ROOT\Directory\Background\shell\TakeOwnership]
@="Take Ownership"
"Icon"="shell32.dll,69"
[HKEY_CLASSES_ROOT\Directory\Background\shell\TakeOwnership\command]
@="powershell -Command Start-Process cmd -ArgumentList '/c takeown /F \"%V\" /R /D Y && icacls \"%V\" /grant administrators:F & pause' -Verb RunAs"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment