Skip to content

Instantly share code, notes, and snippets.

@Spinarooni
Forked from mrchief/LICENSE.md
Last active May 7, 2018 11:54
Show Gist options
  • Save Spinarooni/55f70be6843f63470527 to your computer and use it in GitHub Desktop.
Save Spinarooni/55f70be6843f63470527 to your computer and use it in GitHub Desktop.
Adds an Open Folder context menu option in Windows for Sublime Text 3.
@echo off
SET stPath=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%stPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text\command" /t REG_SZ /v "" /d "%stPath% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%stPath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text\command" /t REG_SZ /v "" /d "%stPath% \"%%1\"" /f
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment