Created
May 17, 2026 17:18
-
-
Save primaryobjects/e542c268bf257165006d4970995e95dc to your computer and use it in GitHub Desktop.
Add "Open with Sublime Text" to the Windows 10/11 Context Menu Right-Click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| SET "stPath=C:\Program Files\Sublime Text\sublime_text.exe" | |
| rem Add it for all file types | |
| reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text" /ve /d "Open with Sublime Text" /f | |
| reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text" /v Icon /t REG_EXPAND_SZ /d "%stPath%,0" /f | |
| reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text\command" /ve /d "\"%stPath%\" \"%%1\"" /f | |
| rem Add it for folders | |
| reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text" /ve /d "Open with Sublime Text" /f | |
| reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text" /v Icon /t REG_EXPAND_SZ /d "%stPath%,0" /f | |
| reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text\command" /ve /d "\"%stPath%\" \"%%1\"" /f | |
| pause |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right-click the
.batand select "Run as Administrator".