Right-clicking a file will give you the option to open the file with Atom. Run this batch file to add the same feature to folders and their backgrounds.
Last active
March 31, 2016 18:04
-
-
Save jordanbtucker/e453ee2835a3364f4d96 to your computer and use it in GitHub Desktop.
Add an "Open with Atom" context menu to folders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
net session > nul 2>&1 | |
if /i not %errorlevel%==0 ( | |
echo You must run this from an elevated prompt. | |
goto:eof | |
) | |
for /f "delims=" %%a in ('where atom') do set atompath=%%a | |
call :getdirname "%atompath%" | |
pushd "%atompath%..\lib" | |
set atompath=%cd% | |
for /f "delims=" %%a in ('dir /b Atom.*') do set atomdir=%%a | |
set atompath=%atompath%\%atomdir%\tools\Atom\atom.exe | |
reg add HKCR\Directory\shell\Atom /d "Open with Atom" /f > nul 2>&1 | |
reg add HKCR\Directory\Background\shell\Atom /d "Open with Atom" /f > nul 2>&1 | |
reg add HKCR\Directory\shell\Atom\command /d "\"%atompath%\" \"%%V\"" /f > nul 2>&1 | |
reg add HKCR\Directory\Background\shell\Atom\command /d "\"%atompath%\" \"%%V\"" /f > nul 2>&1 | |
popd | |
goto:eof | |
:getdirname | |
set atompath=%~dp1 | |
goto:eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment