Skip to content

Instantly share code, notes, and snippets.

@kyle-ilantzis
Last active June 1, 2021 17:20
Show Gist options
  • Star 64 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save kyle-ilantzis/c5a30fbabe8923130581 to your computer and use it in GitHub Desktop.
Save kyle-ilantzis/c5a30fbabe8923130581 to your computer and use it in GitHub Desktop.
Adds 'Open in Atom' to context menu in Windows Explorer.
Windows Registry Editor Version 5.00
;
; Adds 'Open in Atom' to context menu (when you right click) in Windows Explorer.
;
; Based on https://github.com/Zren/atom-windows-context-menu. It didn't work
; https://github.com/Zren/atom-windows-context-menu/issues/1.
;
; Save this file to disk with a .reg extension. Replace C:\\Atom\\atom.exe with
; the path to the atom executable on your machine.
;
; Make sure you are running as administrator.
;
; Double click the file and then click yes on the popup.
;
; OR
;
; open a command prompt and type
; C:> regedit path\to\open-w-atom.reg
;
; That's it!
;
; License, MIT
; when you right click a file
[HKEY_CLASSES_ROOT\*\shell\Atom KI ext]
""="Open File in Atom"
"Icon"="C:\\Atom\\atom.exe"
[HKEY_CLASSES_ROOT\*\shell\Atom KI ext\command]
""="C:\\Atom\\atom.exe \"%1\""
; when you right click a folder
[HKEY_CLASSES_ROOT\Directory\shell\Atom KI ext]
""="Open Folder in Atom"
"Icon"="C:\\Atom\\atom.exe"
[HKEY_CLASSES_ROOT\Directory\shell\Atom KI ext\command]
""="C:\\Atom\\atom.exe \"%1\""
; when you right click a folder while holding shift
[HKEY_CLASSES_ROOT\Directory\Background\shell\Atom KI ext]
""="Open Folder in Atom"
"Icon"="C:\\Atom\\atom.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Atom KI ext\command]
""="C:\\Atom\\atom.exe \"%V\""
; when you right click the background, not on a particular file or folder.
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Atom KI ext]
""="Open Folder in Atom"
"Icon"="C:\\Atom\\atom.exe"
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Atom KI ext\command]
""="C:\\Atom\\atom.exe \"%V\""
Copyright (c) 2014 Kyle Ilantzis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@dustinpoissant
Copy link

This is awesome, is there a "remove" script as well?

@framm
Copy link

framm commented Dec 15, 2016

A "remove" script would be awesome

@tusharkathuria
Copy link

Hi, I get following message in alert when I try to click on Open with Atom:
This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel.
Am i doing anything wrong?

@codekraft-studio
Copy link

codekraft-studio commented Jan 3, 2017

@tusharkathuria by default atom is installed to C:\Users\{USER_NAME}\AppData\Local\atom where {USER_NAME} is your windows user name. I wonder how this reg script is working since in C:\Atom there is nothing for the most of the installations.

So, if your username is tusharkathuria, the regedit value should be: C:\Users\tusharkathuria\AppData\Local\atom\bin\atom.cmd %1

Edit: in newer versions of Atom, I'm using 1.12.x there is a checkbox for enable/disable this feature in Settings->System, you can access to it by pressing Ctrl + ,

@Aleksandern
Copy link

111

@calexHG
Copy link

calexHG commented Jan 13, 2017

Thanks for the removal tips @codekraft-studio and @Aleksandern.
It seems that doesn't work when trying to remove the old ones, however. CCleaner did the job though.

hmm... strangely, GitHub isn't providing any autocompletion for @username mentions o_o. Maybe that's just how it goes on gists..

@isapir
Copy link

isapir commented Feb 26, 2017

@Aleksandern Awesome :)

@hamed-farag
Copy link

@framm @dustinpoissant

Remove One

Windows Registry Editor Version 5.00

;
; Removes 'Open in Atom' from context menu (when you right click) in Windows Explorer.
;
; That's it!
;
; License, MIT

[-HKEY_CLASSES_ROOT\*\shell\Atom KI ext]
[-HKEY_CLASSES_ROOT\*\shell\Atom KI ext\command]
[-HKEY_CLASSES_ROOT\Directory\shell\Atom KI ext]
[-HKEY_CLASSES_ROOT\Directory\shell\Atom KI ext\command]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Atom KI ext]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Atom KI ext\command]
[-HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Atom KI ext]
[-HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Atom KI ext\command]

Save file as .reg

@felipebraga
Copy link

@Aleksandern

That's perfect. Thanks

@the94air
Copy link

the94air commented May 9, 2017

Thanks @Aleksandern . It is simple as pie 👍

@mpolinowski
Copy link

@Aleksandern

Thanks!

@nguyentrithuc
Copy link

@Aleksandern Very nice and simple! Thanks.

@tbntdima
Copy link

@Aleksandern thanks man!

@Akram1234
Copy link

@hamed-farag thanks man !

@uluQulu
Copy link

uluQulu commented Feb 23, 2018

@BISASAM
Copy link

BISASAM commented Jun 5, 2018

NICE

@SuperDizor
Copy link

Thanks guys

@yena-choi
Copy link

Perfect. Thank you!

@MacaylaMarvelous81
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment