Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RellikJaeger/670a25b09a7375994aa123335cde135a to your computer and use it in GitHub Desktop.
Save RellikJaeger/670a25b09a7375994aa123335cde135a to your computer and use it in GitHub Desktop.
Add "Open with Sublime Text" (Sublime Text 4) to Windows Explorer Context Menu (Please run as administrator)
@echo off
set path=%ProgramFiles%\Sublime Text\sublime_text.exe
rem add it for all file types
reg add "HKCR\*\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
reg add "HKCR\*\shell\Open with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%path%,0" /f
reg add "HKCR\*\shell\Open with Sublime Text\command" /t REG_SZ /v "" /d "%path% \"%%1\"" /f
rem add it for folders
reg add "HKCR\Folder\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
reg add "HKCR\Folder\shell\Open with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%path%,0" /f
reg add "HKCR\Folder\shell\Open with Sublime Text\command" /t REG_SZ /v "" /d "%path% \"%%1\"" /f
rem add it for right click on explorer
reg add "HKCR\Directory\Background\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
reg add "HKCR\Directory\Background\shell\Open with Sublime Text" /t REG_SZ /v "Icon" /d "%path%,0" /f
reg add "HKCR\Directory\Background\shell\Open with Sublime Text\command" /t REG_SZ /v "" /d "%path% \"%%V\"" /f
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment