Integrate Sublime Text 3 in Windows 10

Add “Open file/folder with Sublime Text” in context menu in Windows 10

Make sure to replace C:\Portable\sublimetext\sublime_text.exe\ with the appropriate folder

reg add "HKCR\Directory\shell\sublime" /ve /t REG_SZ /d "&Open folder with Sublime Text" /f
reg add "HKCR\Directory\shell\sublime" /v "Icon" /t REG_SZ /d "\"C:\Portable\sublimetext\sublime_text.exe\",0" /f
reg add "HKCR\Directory\shell\sublime\command" /ve /t REG_SZ /d "\"C:\Portable\sublimetext\sublime_text.exe\" \"%1\"" /f
reg add "HKCR\Directory\Background\shell\sublime" /ve /t REG_SZ /d "&Open folder with Sublime Text" /f
reg add "HKCR\Directory\Background\shell\sublime" /v "Icon" /t REG_SZ /d "\"C:\Portable\sublimetext\sublime_text.exe\",0" /f
reg add "HKCR\Directory\Background\shell\sublime\command" /ve /t REG_SZ /d "\"C:\Portable\sublimetext\sublime_text.exe\" \"%V\"" /f
reg add "HKCR\*\shell" /ve /t REG_SZ /d "Edit file with Sublime Text" /f
reg add "HKCR\*\shell" /v "Icon" /t REG_SZ /d "\"C:\Portable\sublimetext\sublime_text.exe\",0" /f
reg add "HKCR\*\shell\Sublime" /ve /t REG_SZ /d "&Edit file with Sublime Text" /f
reg add "HKCR\*\shell\Sublime" /v "Icon" /t REG_SZ /d "\"C:\Portable\sublimetext\sublime_text.exe\",0" /f
reg add "HKCR\*\shell\Sublime\command" /ve /t REG_SZ /d "\"C:\Portable\sublimetext\sublime_text.exe\" \"%1\"" /f

Replace Notepad with Sublime Text 3

I am using a portable version of Sublime Text that I keep in C:\Portable\sublimetext\. I use notepadreplacer to replace Notepad with Sublime Text 3. I have made a batch file that will silently install the notepadreplacer but also point the installer to the correct path of sublime_text.exe. This is the directory structure:

C:
└───Portable
│   └───sublimetext
|       |   sublime_text.exe
|       |   silent_install_notepadreplacer.bat
|       |   ...other_sublime_content_files
│       └───notepadreplacer
|               NotepadReplacerSetup-1.2.exe

Basically just put all the sublime text content in C:\Portable\sublimetext\. Make a new folder under in the directory called notepadreplacer and place the installation file of notepadreplacer there. Put the batch file one level above, in C:\Portable\sublimetext and run it. This is the batch file:

@echo off
for /r "%CD%\notepadreplacer\" %%a in (*.exe) do start /wait "" "%%~fa" /NOTEPAD="%~dp0\sublime_text.exe" /SILENT
pause

The batch file will run any exe file under C:\Portable\sublimetext\notepadreplacer\ and add C:\Portable\sublimetext\sublime_text.exe as the desired text editor.


Sources:

https://stackoverflow.com/a/15340919/2154717

https://forum.sublimetext.com/t/right-click-open-folder-with-sublime-text/13970/10