Make setting Atom as Default Editor for filetypes easier #4893

Closed
hebbet opened this Issue Jan 7, 2015 · 51 comments

Comments

Projects
None yet
@hebbet

hebbet commented Jan 7, 2015

Currently it is not so easy to assign atom as default editor on windows eg for all .css files

the path to atom.exe is changed with every update.

no exe in C:\Users\hebbet\AppData\Local\atom
image

Chrome has eg an chrome.exe in:
C:\Users\username\AppData\Local\Google\Chrome SxS\Application which starts chrome with the currect folder.

image

@kevinsawicki

This comment has been minimized.

Show comment
Hide comment
@kevinsawicki

kevinsawicki Jan 7, 2015

Member

Have you tried using C:\Users\hebbet\AppData\Local\atom\bin\atom?

That should be a consistent location that always points to the latest installed release

Member

kevinsawicki commented Jan 7, 2015

Have you tried using C:\Users\hebbet\AppData\Local\atom\bin\atom?

That should be a consistent location that always points to the latest installed release

@hebbet

This comment has been minimized.

Show comment
Hide comment
@hebbet

hebbet Jan 7, 2015

With atom it doesn't work. Tested with Windows 7 and 8.

With atom.cmd it works but with an pretty annoying cmd Window for a very
short time.
On Jan 7, 2015 10:35 PM, "Kevin Sawicki" notifications@github.com wrote:

Have you tried using C:\Users\hebbet\AppData\Local\atom\bin\atom?

That should be a consistent location that always points to the latest
installed release


Reply to this email directly or view it on GitHub
#4893 (comment).

hebbet commented Jan 7, 2015

With atom it doesn't work. Tested with Windows 7 and 8.

With atom.cmd it works but with an pretty annoying cmd Window for a very
short time.
On Jan 7, 2015 10:35 PM, "Kevin Sawicki" notifications@github.com wrote:

Have you tried using C:\Users\hebbet\AppData\Local\atom\bin\atom?

That should be a consistent location that always points to the latest
installed release


Reply to this email directly or view it on GitHub
#4893 (comment).

@sick51

This comment has been minimized.

Show comment
Hide comment
@sick51

sick51 Feb 11, 2015

I tried to use .lnk file in the start menu instead of the .cmd file and it seems to work. The annoying cmd window does not appear anymore.
(C:\Users[you]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\GitHub, Inc)

sick51 commented Feb 11, 2015

I tried to use .lnk file in the start menu instead of the .cmd file and it seems to work. The annoying cmd window does not appear anymore.
(C:\Users[you]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\GitHub, Inc)

@ArtskydJ

This comment has been minimized.

Show comment
Hide comment
@ArtskydJ

ArtskydJ Feb 26, 2015

Thanks @sick51, it works for me!

Thanks @sick51, it works for me!

@samirotiv

This comment has been minimized.

Show comment
Hide comment
@samirotiv

samirotiv Mar 24, 2015

Doesn't work for me - I tried opening a C file in Windows 8 using the Start Menu shortcut, and it showed a Command Prompt window (which itself is alright), but then didn't proceed after that.

I should mention, when I click on the icon, Atom seems to open correctly.

The target of the shortcut is:
C:\Users\Samir\AppData\Local\atom\Update.exe --processStart atom.exe

I suspect the file path is an invalid parameter for this.

Doesn't work for me - I tried opening a C file in Windows 8 using the Start Menu shortcut, and it showed a Command Prompt window (which itself is alright), but then didn't proceed after that.

I should mention, when I click on the icon, Atom seems to open correctly.

The target of the shortcut is:
C:\Users\Samir\AppData\Local\atom\Update.exe --processStart atom.exe

I suspect the file path is an invalid parameter for this.

@ArtskydJ

This comment has been minimized.

Show comment
Hide comment
@ArtskydJ

ArtskydJ Mar 24, 2015

@samirotiv The shortcut target should be C:\Users\[you]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\GitHub, Inc\atom.exe

@samirotiv The shortcut target should be C:\Users\[you]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\GitHub, Inc\atom.exe

@samirotiv

This comment has been minimized.

Show comment
Hide comment
@samirotiv

samirotiv Mar 24, 2015

I think there's something wrong with that since the executable surely
wouldn't be in the Start Menu (and it indeed isn't), and the shortcut in
the Start Menu won't point to an executable in the same folder.

The location I wrote above is the target of the shortcut in the Start Menu.

Regards,
Samir.

On Tuesday, March 24, 2015, Joseph Dykstra notifications@github.com wrote:

@samirotiv https://github.com/samirotiv The shortcut target should be C:\Users[you]\AppData\Roaming\Microsoft\Windows\Start
Menu\Programs\GitHub, Inc\atom.exe


Reply to this email directly or view it on GitHub
#4893 (comment).

I think there's something wrong with that since the executable surely
wouldn't be in the Start Menu (and it indeed isn't), and the shortcut in
the Start Menu won't point to an executable in the same folder.

The location I wrote above is the target of the shortcut in the Start Menu.

Regards,
Samir.

On Tuesday, March 24, 2015, Joseph Dykstra notifications@github.com wrote:

@samirotiv https://github.com/samirotiv The shortcut target should be C:\Users[you]\AppData\Roaming\Microsoft\Windows\Start
Menu\Programs\GitHub, Inc\atom.exe


Reply to this email directly or view it on GitHub
#4893 (comment).

@dogancelik

This comment has been minimized.

Show comment
Hide comment
@dogancelik

dogancelik Apr 28, 2015

It's easy to set Atom as default editor.

  1. Go to Windows Explorer
  2. Select a .txt file, right click, go to Open with, then Choose default program
  3. In dialog, copy and paste this: %LOCALAPPDATA%\atom\bin\atom.cmd and click OK

Here's a GIF

atom.cmd is a shortcut to the latest version of Atom.

It's easy to set Atom as default editor.

  1. Go to Windows Explorer
  2. Select a .txt file, right click, go to Open with, then Choose default program
  3. In dialog, copy and paste this: %LOCALAPPDATA%\atom\bin\atom.cmd and click OK

Here's a GIF

atom.cmd is a shortcut to the latest version of Atom.

@Amleto

This comment has been minimized.

Show comment
Hide comment
@Amleto

Amleto May 2, 2015

I used the atom installer for win 7. There is no bin directory in %LOCALAPPDATA%\atom

Amleto commented May 2, 2015

I used the atom installer for win 7. There is no bin directory in %LOCALAPPDATA%\atom

@dogancelik

This comment has been minimized.

Show comment
Hide comment
@dogancelik

dogancelik May 2, 2015

@Amleto

Create a new batch file and save it as atom.cmd and put it in %LOCALAPPDATA%\atom\bin\ then make sure that directory is in PATH.

@echo off
FOR /F "delims=" %%i IN ('dir %LOCALAPPDATA%\atom\app-* /b /ad-h /t:c /o:d') DO SET foldername=%%i
%LOCALAPPDATA%\atom\%foldername%\resources\cli\atom.cmd

This batch file I created will get the latest version of Atom and start it.

@Amleto

Create a new batch file and save it as atom.cmd and put it in %LOCALAPPDATA%\atom\bin\ then make sure that directory is in PATH.

@echo off
FOR /F "delims=" %%i IN ('dir %LOCALAPPDATA%\atom\app-* /b /ad-h /t:c /o:d') DO SET foldername=%%i
%LOCALAPPDATA%\atom\%foldername%\resources\cli\atom.cmd

This batch file I created will get the latest version of Atom and start it.

@bilderbuchi

This comment has been minimized.

Show comment
Hide comment
@bilderbuchi

bilderbuchi May 11, 2015

👍 on this issue. While targeting atom.cmd works, it's not really a great workaround, since

  • you have to know and manually paste the path to that cmd file
  • you get a blank rectangle as the file icon, not the Atom logo, so the file association is not clear.
  • you get an annoying short flicker of a terminal when opening files, which you don't get when opening Atom itself via the start menu.

👍 on this issue. While targeting atom.cmd works, it's not really a great workaround, since

  • you have to know and manually paste the path to that cmd file
  • you get a blank rectangle as the file icon, not the Atom logo, so the file association is not clear.
  • you get an annoying short flicker of a terminal when opening files, which you don't get when opening Atom itself via the start menu.
@samirotiv

This comment has been minimized.

Show comment
Hide comment
@samirotiv

samirotiv May 11, 2015

Touché.

On Mon, May 11, 2015 at 6:24 PM, Christoph Buchner <notifications@github.com

wrote:

[image: 👍] on this issue. While targeting atom.cmd works, it's not
really a great workaround, since

  • you have to know and manually paste the path to that cmd file
  • you get a blank rectangle as the file icon, not the Atom logo, so
    the file association is not clear.
  • you get an annoying short flicker of a terminal when opening files,
    which you don't get when opening Atom itself via the start menu.


Reply to this email directly or view it on GitHub
#4893 (comment).

Touché.

On Mon, May 11, 2015 at 6:24 PM, Christoph Buchner <notifications@github.com

wrote:

[image: 👍] on this issue. While targeting atom.cmd works, it's not
really a great workaround, since

  • you have to know and manually paste the path to that cmd file
  • you get a blank rectangle as the file icon, not the Atom logo, so
    the file association is not clear.
  • you get an annoying short flicker of a terminal when opening files,
    which you don't get when opening Atom itself via the start menu.


Reply to this email directly or view it on GitHub
#4893 (comment).

@rjv

This comment has been minimized.

Show comment
Hide comment

rjv commented May 18, 2015

👍

@atom-project

This comment has been minimized.

Show comment
Hide comment

👍

@ceddc

This comment has been minimized.

Show comment
Hide comment

ceddc commented May 27, 2015

👍

@dogancelik

This comment has been minimized.

Show comment
Hide comment
@dogancelik

dogancelik Jun 4, 2015

As @bilderbuchi said, that terminal dialog before Atom is really annoying and takes a lot of time.

As @bilderbuchi said, that terminal dialog before Atom is really annoying and takes a lot of time.

@refactorsaurusrex

This comment has been minimized.

Show comment
Hide comment
@designisokay

This comment has been minimized.

Show comment
Hide comment

👍

@belldandu

This comment has been minimized.

Show comment
Hide comment

👍

@rjfmachado

This comment has been minimized.

Show comment
Hide comment

👍

@nhogle

This comment has been minimized.

Show comment
Hide comment
@nhogle

nhogle Jun 26, 2015

👍👍

nhogle commented Jun 26, 2015

👍👍

@MatthewSteen

This comment has been minimized.

Show comment
Hide comment

👍

@tylerapplebaum

This comment has been minimized.

Show comment
Hide comment

👍

@JamesMilnerUK

This comment has been minimized.

Show comment
Hide comment
@JamesMilnerUK

JamesMilnerUK Jul 3, 2015

👍 The atom.cmd workaround does work but it leads to no atom icon being displayed for associated files, which is kind of ugly unfortunately.

👍 The atom.cmd workaround does work but it leads to no atom icon being displayed for associated files, which is kind of ugly unfortunately.

@dogancelik

This comment has been minimized.

Show comment
Hide comment
@dogancelik

dogancelik Jul 6, 2015

A solution could be: A C program (compiled with MinGW) that finds latest folder, starts Atom
This program would find the latest Atom folder (AppData\Local\atom\app-1.0.0\), and behave like the batch file resources\cli\atom.cmd

Edit: Or read from an INI or TXT file, something like version.txt that only contains folder name
Edit 2: I think reading from version.txt is better, because you only have to build the launcher once.

A solution could be: A C program (compiled with MinGW) that finds latest folder, starts Atom
This program would find the latest Atom folder (AppData\Local\atom\app-1.0.0\), and behave like the batch file resources\cli\atom.cmd

Edit: Or read from an INI or TXT file, something like version.txt that only contains folder name
Edit 2: I think reading from version.txt is better, because you only have to build the launcher once.

@swharrell

This comment has been minimized.

Show comment
Hide comment
@swharrell

swharrell Jul 9, 2015

👍 Love the editor but this is an annoying issue.

👍 Love the editor but this is an annoying issue.

@crabilld

This comment has been minimized.

Show comment
Hide comment
@crabilld

crabilld Jul 9, 2015

Hello Windows 95:
win-95-ftw

crabilld commented Jul 9, 2015

Hello Windows 95:
win-95-ftw

@PerfectSlayer

This comment has been minimized.

Show comment
Hide comment
@PerfectSlayer

PerfectSlayer Jul 10, 2015

Please add this! 👍

Please add this! 👍

@w1res

This comment has been minimized.

Show comment
Hide comment
@w1res

w1res Jul 13, 2015

The solutions here work, but the icon wrong (it is the ugly system default) and it isn't clear what program you are opening the file with just by looking.

w1res commented Jul 13, 2015

The solutions here work, but the icon wrong (it is the ugly system default) and it isn't clear what program you are opening the file with just by looking.

@shiftkey

This comment has been minimized.

Show comment
Hide comment
@shiftkey

shiftkey Jul 16, 2015

There's a lot going on in here, so I'll just summarize the feedback as I see it:

  • it'd be nice to have Atom appear in the "Default Programs" list - how this will work with the potentially unknown number of file extensions available, I'm not sure.
  • when manually setting Atom to be associated with a specific extension using atom.cmd, the icon is not used. That should be addressed with the previous step.
  • the current workaround for pointing to the atom.cmd script means a command prompt is launched and is visible for a few seconds before disappearing - perhaps an alternative approach is necessary here so we can hide this away.

Did I miss anything?

There's a lot going on in here, so I'll just summarize the feedback as I see it:

  • it'd be nice to have Atom appear in the "Default Programs" list - how this will work with the potentially unknown number of file extensions available, I'm not sure.
  • when manually setting Atom to be associated with a specific extension using atom.cmd, the icon is not used. That should be addressed with the previous step.
  • the current workaround for pointing to the atom.cmd script means a command prompt is launched and is visible for a few seconds before disappearing - perhaps an alternative approach is necessary here so we can hide this away.

Did I miss anything?

@miroslawlis

This comment has been minimized.

Show comment
Hide comment

👍

@batjko

This comment has been minimized.

Show comment
Hide comment
@batjko

batjko Jul 17, 2015

Contributor

Please, the added +1s are just adding noise at this point. People are aware of the gravity of the request, as Windows is a big user base for Atom (and Electron incidentally), and the issue is being worked on.

Contributor

batjko commented Jul 17, 2015

Please, the added +1s are just adding noise at this point. People are aware of the gravity of the request, as Windows is a big user base for Atom (and Electron incidentally), and the issue is being worked on.

@samirotiv

This comment has been minimized.

Show comment
Hide comment
@samirotiv

samirotiv Jul 19, 2015

+1 to your comment. ;)

On Saturday, July 18, 2015, Patrick Metzdorf notifications@github.com
wrote:

Please, the added +1s are just adding noise at this point. People are
aware of the gravity of the request, as Windows is a big user base for Atom
(and Electron incidentally), and the issue is being worked on.


Reply to this email directly or view it on GitHub
#4893 (comment).

+1 to your comment. ;)

On Saturday, July 18, 2015, Patrick Metzdorf notifications@github.com
wrote:

Please, the added +1s are just adding noise at this point. People are
aware of the gravity of the request, as Windows is a big user base for Atom
(and Electron incidentally), and the issue is being worked on.


Reply to this email directly or view it on GitHub
#4893 (comment).

@bilderbuchi

This comment has been minimized.

Show comment
Hide comment
@bilderbuchi

bilderbuchi Jul 20, 2015

and the issue is being worked on.

@batjko is that so? There is no label on this issue that would indicate that (like in-progress, work-in-progress, under-review)

and the issue is being worked on.

@batjko is that so? There is no label on this issue that would indicate that (like in-progress, work-in-progress, under-review)

@shiftkey

This comment has been minimized.

Show comment
Hide comment
@shiftkey

shiftkey Jul 20, 2015

@bilderbuchi

is that so? There is no label on this issue that would indicate that

You're right, the issue is still unassigned. Sorry for not making it clearer what I've been up to.

@bilderbuchi

is that so? There is no label on this issue that would indicate that

You're right, the issue is still unassigned. Sorry for not making it clearer what I've been up to.

@batjko

This comment has been minimized.

Show comment
Hide comment
@batjko

batjko Jul 20, 2015

Contributor

@batjko is that so? There is no label on this issue that would indicate that (like in-progress, work-in-progress, under-review)

Well, it's just something one adds to a comment like that ;)
Nonetheless, awareness has been raised to the point where any further +1's don't add any value.

Contributor

batjko commented Jul 20, 2015

@batjko is that so? There is no label on this issue that would indicate that (like in-progress, work-in-progress, under-review)

Well, it's just something one adds to a comment like that ;)
Nonetheless, awareness has been raised to the point where any further +1's don't add any value.

@belldandu

This comment has been minimized.

Show comment
Hide comment
@belldandu

belldandu Jul 20, 2015

Mfw my email has been spammed with these DaMN +1's chill please. BTW you can easily just make a simple wrapper exe that calls the function for opening files in atom and have that automatically set to be default on install.

Mfw my email has been spammed with these DaMN +1's chill please. BTW you can easily just make a simple wrapper exe that calls the function for opening files in atom and have that automatically set to be default on install.

@spenat28

This comment has been minimized.

Show comment
Hide comment

+1

@mnquintana

This comment has been minimized.

Show comment
Hide comment
@mnquintana

mnquintana Jul 21, 2015

Member

All these +1s and 👍s are just adding noise, so to minimize that I'm going to lock this issue for now – we may unlock it once someone starts working on this enhancement to get further feedback.

Member

mnquintana commented Jul 21, 2015

All these +1s and 👍s are just adding noise, so to minimize that I'm going to lock this issue for now – we may unlock it once someone starts working on this enhancement to get further feedback.

@atom atom locked and limited conversation to collaborators Jul 21, 2015

@atom atom unlocked this conversation Aug 1, 2015

@wmhilton

This comment has been minimized.

Show comment
Hide comment
@wmhilton

wmhilton Aug 1, 2015

I made a workaround using AutoHotKey.

atom.ahk:

Run, %LocalAppData%\atom\bin\atom.cmd %1% %2% %3% %4% %5% %6% %7% %8% %9% %10%,,Hide

Then using Ahk2Exe for AutoHotkey:
screenshot_11

Now when I set filetypes to "Open With..."
screenshot_14

They have this nice icon:
image

wmhilton commented Aug 1, 2015

I made a workaround using AutoHotKey.

atom.ahk:

Run, %LocalAppData%\atom\bin\atom.cmd %1% %2% %3% %4% %5% %6% %7% %8% %9% %10%,,Hide

Then using Ahk2Exe for AutoHotkey:
screenshot_11

Now when I set filetypes to "Open With..."
screenshot_14

They have this nice icon:
image

@regendo

This comment has been minimized.

Show comment
Hide comment
@regendo

regendo Aug 5, 2015

That autohotkey script doesn't work for files with spaces in their file name. With quotes, it does.

Run, %LocalAppData%\atom\bin\atom.cmd "%1%",,Hide

regendo commented Aug 5, 2015

That autohotkey script doesn't work for files with spaces in their file name. With quotes, it does.

Run, %LocalAppData%\atom\bin\atom.cmd "%1%",,Hide
@chriswils

This comment has been minimized.

Show comment
Hide comment
@chriswils

chriswils Aug 11, 2015

I tried your solution @wmhilton but the Open With... dialog wont "find" the generated exe (tested to be working) even though I'm pointing right at it...

I tried your solution @wmhilton but the Open With... dialog wont "find" the generated exe (tested to be working) even though I'm pointing right at it...

@johnrezzo

This comment has been minimized.

Show comment
Hide comment
@johnrezzo

johnrezzo Aug 11, 2015

Definitely need a fix for this. It would be good to have an Atom setting with all the main file extensions to choose from.

Definitely need a fix for this. It would be good to have an Atom setting with all the main file extensions to choose from.

@RogerSik

This comment has been minimized.

Show comment
Hide comment

👍

@jaybkun

This comment has been minimized.

Show comment
Hide comment

jaybkun commented Aug 19, 2015

👍

@onetrev

This comment has been minimized.

Show comment
Hide comment
@onetrev

onetrev Aug 19, 2015

Stop the thumbs up madness. If you are here to add one, please stop and think. GitHub is not a feature voting system. All these thumbs up are giving Windows users a bad name and not helping Atom folks or the community get this issue fixed.

onetrev commented Aug 19, 2015

Stop the thumbs up madness. If you are here to add one, please stop and think. GitHub is not a feature voting system. All these thumbs up are giving Windows users a bad name and not helping Atom folks or the community get this issue fixed.

@bilderbuchi

This comment has been minimized.

Show comment
Hide comment
@bilderbuchi

bilderbuchi Aug 19, 2015

They do help to make the Atom team be aware of the scope of this issue / the big number of affected users, so they may prioritize issues accordingly.
This is not giving Windows users a bad name, this is giving the Github issue tracking system a bad name for not having something like google code "stars" or Launchpad "affects me too!" -equivalent systems implemented. ;-)

They do help to make the Atom team be aware of the scope of this issue / the big number of affected users, so they may prioritize issues accordingly.
This is not giving Windows users a bad name, this is giving the Github issue tracking system a bad name for not having something like google code "stars" or Launchpad "affects me too!" -equivalent systems implemented. ;-)

@mnquintana

This comment has been minimized.

Show comment
Hide comment
@mnquintana

mnquintana Aug 19, 2015

Member

They do help to make the Atom team be aware of the scope of this issue / the big number of affected users, so they may prioritize issues accordingly.

Unfortunately, not really. 👍s are only helpful up to a certain threshold - beyond that they're just noise.

I unlocked this issue to let someone post a useful workaround for subscribers to this issue, but now that it's devolved into +1s again I'm going to re-lock it to keep the noise levels down.

Member

mnquintana commented Aug 19, 2015

They do help to make the Atom team be aware of the scope of this issue / the big number of affected users, so they may prioritize issues accordingly.

Unfortunately, not really. 👍s are only helpful up to a certain threshold - beyond that they're just noise.

I unlocked this issue to let someone post a useful workaround for subscribers to this issue, but now that it's devolved into +1s again I'm going to re-lock it to keep the noise levels down.

@atom atom locked and limited conversation to collaborators Aug 19, 2015

@damieng damieng self-assigned this Feb 14, 2016

@damieng

This comment has been minimized.

Show comment
Hide comment
@damieng

damieng Feb 16, 2016

Contributor

Fix checked in to master. Will now appear in the list of apps from "Open With..." and the update will take care of updating/correcting the exe path.

Contributor

damieng commented Feb 16, 2016

Fix checked in to master. Will now appear in the list of apps from "Open With..." and the update will take care of updating/correcting the exe path.

@damieng damieng closed this Feb 16, 2016

@50Wliu

This comment has been minimized.

Show comment
Hide comment
@50Wliu

50Wliu Feb 20, 2016

Member

To clarify, Atom will only appear in the "Open With" list starting in Atom 1.7.0. After upgrading to 1.7.0 (when it's released), if Atom is still missing in the Open With menu, please file a new issue. Thanks!

Member

50Wliu commented Feb 20, 2016

To clarify, Atom will only appear in the "Open With" list starting in Atom 1.7.0. After upgrading to 1.7.0 (when it's released), if Atom is still missing in the Open With menu, please file a new issue. Thanks!

@damieng

This comment has been minimized.

Show comment
Hide comment
@damieng

damieng Feb 25, 2016

Contributor

Screenshots showing this fix in action are at #10818

Contributor

damieng commented Feb 25, 2016

Screenshots showing this fix in action are at #10818

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