Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have already read the question about Creating .desktop files to use on the "Open with other application" tab but this is not what I want, I want to be able to click on the file in Dash or in Nautilus and be able to open it with the specified app.

For example I have this case right now:

When I click on an EXE file it does not get executed by Wine, instead I get the following:

enter image description here

If I try to look for Wine in the Open With context menu option it is there. I am fine executing it from there the first time, but then the following times Wine does not appears selected in the main Context menu:

enter image description here

I then went to Properties to the Open With Tab to look for Wine. It was not in the Default apps nor was it in the Recommended ones when I clicked and search on Show other applications

enter image description here

This is not limited to EXE extensions. It also has happened with MKV files, MP4 files, JPG, PNG, MP3 and even SVG and CSS. So instead of trying to find a way of solving it for one, I want a way that can be done to any type of extension that can:

  • Make the app the default of that extension
  • Appear on the context menu in Nautilus when I right click on the file
  • Appears on the "Open With" tab on the Property window of the file
  • Correctly executes the specified app when I click on the file with Dash

This might sound like it should be common sense for an app to execute the file but it does not always work like that. So for the cases where it actually does not work, how to fix it. A reset of the extension?, An update of the files that can open said extension?, an addition of the app via a command line or GUI tool?

share|improve this question
    
Have a look at askubuntu.com/a/189284/41499 it uses Ubuntu Tweak –  Gerhard Burger Jan 6 '13 at 20:02
    
Give me a moment to test it out. Although I was looking for a way that did not need to install a PPA. Something for example that was already IN Ubuntu. –  Luis Alvarado Jan 6 '13 at 20:08
    
Can you add it as an answer, at least until a more "Ubuntu-ish" option comes along. It does change the app for the extension but I have a case where there is not internet. –  Luis Alvarado Jan 6 '13 at 20:12
    
I feel bad just copying it, or should I just copy my comment to an answer? It would be nice to see what Ubuntu Tweak actually does, it makes some extra desktop files, but I don't know if it does anything extra... –  Gerhard Burger Jan 6 '13 at 20:16
    
Found a better, more "Ubuntu-ish" option ;) –  Gerhard Burger Jan 6 '13 at 20:28

1 Answer 1

up vote 10 down vote accepted

You can use the command mimeopen, in a terminal go to the folder where your .exe file is and type

mimeopen -d filename.exe

You will get a popup menu, where you can see some options, but there is also an option 'Other...', choose this one, then type the command which you would use if you would open the file in the terminal and replace the filename with %f. So in this case you would type wine %f.

Now the default association for all exe files should be changed to wine.

Alternative, using Ubuntu-Tweak as described in Change all associations from gedit to another application will also change the default app associated.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.