Essays

Essays

How to Remove Sublime Text from Context Menu after Uninstall on Windows 10

How to Remove Sublime Text from Context Menu after Uninstall on Windows 10

Subscribe to my newsletter and never miss my upcoming articles

Do you get that feeling when something is there but it's actually not supposed to be there?

After uninstalling Sublime Text on my Windows 10 machine, I can't help but be frustrated with the remnants of such text editor (I have nothing against ST btw). I am content with VS Code at the moment and for quick edits, I use Notepad++ or Vim.

Steps

  1. Right-click on any text document, just to be sure that the "Open with Sublime Text" is there.
  2. If there is such an option, create a text document and open it with Sublime Text (think of it as your final farewell to the text editor in your machine).
  3. Copy the code below and paste it into that document.
@echo off

rem delete it for all file types
@reg delete "HKCR\*\shell\Sublime" /f
@reg delete "HKCR\*\shell\Open with Sublime Text" /f
@reg delete "HKCR\*\shell\Open with Sublime Text 2" /f
@reg delete "HKCR\*\shell\Open with Sublime Text 3" /f

rem delete it for folders
@reg delete "HKCR\Folder\shell\Sublime" /f
@reg delete "HKCR\Folder\shell\Open with Sublime Text" /f
@reg delete "HKCR\Folder\shell\Open with Sublime Text 2" /f
@reg delete "HKCR\Folder\shell\Open with Sublime Text 3" /f

rem delete it for right click on explorer
@reg delete "HKCR\Directory\Background\shell\Sublime" /f
@reg delete "HKCR\Directory\Background\shell\Open with Sublime Text" /f
@reg delete "HKCR\Directory\Background\shell\Open with Sublime Text 2" /f
@reg delete "HKCR\Directory\Background\shell\Open with Sublime Text 3" /f
@reg delete "HKCR\Directory\Background\shell\Open with Sublime Text 4" /f

msg * DONE!
  1. Save the document on your desktop and name it remove-st.bat.
  2. Right-click on the .bat file and choose "Run as Administrator".
  3. When everything is complete, you should see the msg with DONE!
  4. Right-click again on any file, you should see that the Sublime-text option is no longer there.

Have a good day!


P.S.

I saw this somewhere in GitHub a few months ago, but I could no longer find the link. Luckily, I still have the .bat file on my computer.

 
Share this