Making Sublime Text portable version have right-click>edit functionality

From mrchief, this solution lets you do right click on a file and do something like this >
SublimeText.png

Simply save the code below as a bat or even just run it off console with the proper path for you Sublime Text (or any reg entry to be honest)

@echo off
SET st2Path=C:\Program Files\Sublime Text 2.0.2\sublime_text.exe
 
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2"         /t REG_SZ /v "" /d "Open with Sublime Text 2"   /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2"         /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
 
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2"         /t REG_SZ /v "" /d "Open with Sublime Text 2"   /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2"         /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
pausesd
 
1
Kudos
 
1
Kudos

Now read this

Event Propagation and Event Delegation

This is a key part of JavaScript functionality outlined in the W3C Document Object Model (DOM) Level 2 Events Specification. Event Propagation # This flow occurs when an event takes place such as a click, hover, or mousedown. The... Continue →