Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RellikJaeger/06c56e49e694971de2949a490f2b6c4b to your computer and use it in GitHub Desktop.
Save RellikJaeger/06c56e49e694971de2949a490f2b6c4b to your computer and use it in GitHub Desktop.
Add "Open with Sublime Text 3" to Windows Explorer Context Menu (including folder and current directory)
@echo off
set path=%ProgramFiles%\Sublime Text 3\sublime_text.exe
:: File
reg add "HKCR\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
reg add "HKCR\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%path%,0" /f
reg add "HKCR\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%path% \"%%1\"" /f
:: Folder
reg add "HKCR\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
reg add "HKCR\Folder\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%path%,0" /f
reg add "HKCR\Folder\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%path% \"%%1\"" /f
:: Current directory
reg add "HKCR\Directory\Background\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
reg add "HKCR\Directory\Background\shell\Open with Sublime Text 3" /t REG_SZ /v "Icon" /d "%path%,0" /f
reg add "HKCR\Directory\Background\shell\Open with Sublime Text 3\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