How to open user system "select program to open with" for given file?

Hi,
I'm trying to make file management application in Java.
I already know how to open file in system preferred application. It's quite easy.
The other issue I thinking about now is that I need to implement "Open With" functionality (like in Ubuntu: you right press on the file -> select "Open With" -> "Other" and system's default application selection window starts.
I tried to manage that with some Java default classes, but I didn't found one.
So, I'm working on solution, based on Runtime.getRuntime().exec("something");
I already know what commands i should write in Mac and Windows to open "application selection" for file:
1) Windows: RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL <file.ext>
2) Mac: open <file.ext>
How to do same on linux (Gnome/KDE)? I still not found easy solution for that.
Or maybe I am digging in wrong direction? If so - prease correct me.
P.S. I tried Desktop.getDesktop() and Java Desktop Integration Components (JDIC), but it seems, that both of them don't have a function for functionality i need.
Thank you for your replies.

Never seen that one before. Maybe a Linux forum can help with that.
Anyway. since ps seems to be working, you might try the following:
before opening the dialog
ps -auxww | grep <username> | grep -v grep | awk '{print $2}' | sort > beforeafter opeing the dialog (and while it is still open)
ps -auxww | grep <username> | grep -v grep | awk '{print $2}' | sort > after
diff before after
ps -auxww <pidfromabove>

Similar Messages

  • How to set a default open with, for all files

    I would simply like to make all my .avi files to open with VLC, rather than Quicktime. I have done the "change default open with", but it's only for that file.
    Any way to make all avi's open with VLC?
    Thanks!

    Right-click any .AVI file and select Get Info. Under the "Open with" section, select the app you want, and then press the "Change All" button.

  • Change Open With for all files with a specific extension

    Hi, I've been using OS X for quite some time, but more recently cannot see how you do the following which is proving frustrating:
    * Open Get Info for a file,
    * Use the drop down under Open With to choose Other,
    * Select an appropriate application that wasn't on the drop down list (in this case Smultron text editor for CSV files),
    * Press the Change All button and the drop down turns back to Excel which was the previous default.
    So basically, how do I change all files with CSV extension to Smultron when Smultron wasn't in the list of Open With items and I have to use Other from the list. This is repeatable for any file type with any application that isn't listed and is on both my iMac and my work's MacBook. Try it yourself and you'll see what I mean!!
    Thanks

    Stuart Mchattie wrote:
    Thanks NeroWolf,
    Your solution does work for that single file, but doesn't change the system wide association of that file extension with a particular application. It is because this works that I believe the problem I am having is uncircumventable and is in fact a bug in the OS. Could anyone else confirm this?
    Cheers,
    Stuart
    It might be a bug. What I found is that the icon does not change unless I log out/in or reboot, even when the app normally puts an icon on the file.
    For example if I change an audio file to always open with VLC, it does even though the icon remains as before. However, even though clicking plays the audio with VLC, if I right click the file and select "Open With" it still says iTunes (app) default which is incorrect.
    Message was edited by: nerowolfe

  • Can't change "Open with" for multiple files

    For some reason, all swfs on my computer won't open in the Flash player that came with Flash 9. If I select 1 swf and set it to open with the player, it will work, however, if I select multiple ones, get info and try to set them all to open in the player (or "Change All") I get a dialogue saying I don't "have privileges to change the application for these documents only. Do you want to change all similar documents to open with the application Flash Player.app?" This is rediculous because I could so this in Tiger just fine. Also, I'm the admin and i'm in MY account, so I should be able to do anything I want, right?
    Any insights? I've repaired disk permissions by the way.
    Dan P.

    This is sometimes a problem with the launchservices database. You can try the following to fix it:
    Rebuild LaunchServices Database
    For Tiger users
    Open the Terminal application in your Utilities folder. At the prompt paste in the following command in its entirety:
    /System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServic es.framework/Support/lsregister -kill -r -domain local -domain system -domain user
    Press RETURN.
    For Leopard users
    Open the Terminal application in your Utilities folder. At the prompt paste in the following command in its entirety:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    Press RETURN.
    If this isn't successful then there may be other problems involved. You can try this:
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger and Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger, and 4.1 for Leopard) and/or TechTool Pro (4.6.1 for Leopard) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    You can install the freeware preference pane, RCDefaultApp - VersionTracker or MacUpdate - which is useful for extensive control over various file associations.

  • How to restrict user at selection screen while executing in background mode

    hi all,
    how to restrict user at selection screen while executing in background mode
    Regards
    Deepak

    Hi,
    We can get the Program whether this is running in background or not then we need to use SY-BATCH, if the SY-BATCH is set to X then the program is running in Background,
    so in the INITIALIZATION event, you can use this SY-BATCH and check the User names, and give the error messsage which you want to restrict
    Regards
    Sudheer

  • How to make users to select the date from calendar control my making the date field read only in date time control in external list in sharepoint 2010

    How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
    be done through sharepoint desginer / out of the box.
    thanks.

    Congratulate you got the solution by yourself. I am new to a
    WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
    calendar date selection did me a great favor. Cheers.

  • Adf11g how to open pdf or html files from  webservice

    hi all,
    adf11g how to open pdf or html files from webservice .

    Hi,
    This is standard functionality, that you can read more about in the OLM User Manual. You can upload the files to an OLM content server or to any other content server that can be accessed with a URL.
    Regards Anders Northeved

  • How To Restrict Users To Only Create Purchase Requisitions with Item Catalog?

    Hi, everyone 
    Please help me, 
    How To Restrict Users To Only Create Purchase Requisitions with Item Catalog? is it possible? 
    Regards,   Manuel

    Hi Steenie Norman
    First click on the text item ---> Tools ---> Property Pallete ---->
    and change the Keyboard State to Local Only also this Depend in your OS
    hope this useful ....
    Regards
    Mohammed

  • I get a dialogue box asking "What should Firefox do with this file" Options open with or save file. My wife selected save file and now it only opens note pad and displays the text of the file to be saved. OK in windows Internet Explorer.

    I get a dialogue box asking "What should Firefox do with this file" Options open with or save file. My wife selected save file and now it only opens note pad and displays the text of the file to be saved. OK in windows Internet Explorer.

    P.S. Site is http://www.coldwatercreek.com

  • How to open multiple artboard illustrator file in illustrator. Coz, whenever we open a multiple artboard file, illustrator provide an option to chose one artboard but does not allow opening of all artboards. Somebody may explain it

    How to open multiple artboard illustrator file in illustrator. Coz, whenever we open a multiple artboard file, illustrator provide an option to chose one artboard but does not allow opening of all artboards. Somebody may explain it

    Doug's got it right. It sounds like you are trying to open a later version file in an earlier version. This will always be handled as opening the PDF portion of the file. Try Googling AI_openMultiPagePDF for a script to open these or Resave from the newer version to the older.

  • How to open an new Garageband file in Garageband '09?

    How to open an new Garageband file in Garageband '09?

    GarageBand iPad Song files can only be opened on the desktop with GarageBand 11 or later.
    Hope that helps
    Edgar Rothermich
    http://DingDingMusic.com/Manuals/
    'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'

  • How to create users and groups using WLST Offline with Weblogic 8.1.4

    How to create users and groups using WLST Offline with Weblogic 8.1.4?
    Any ideas?

    Hi this is how i created a user using WLST Offline?
    cd('/Security/' + domainName)
    # Delete the default user name weblogic
    # incase you want to remove the defualt user weblogic
    delete('weblogic','User')
    # Creating a new user defined
    create(userName, 'User')
    # Setting the password of the user you created.
    cd ('/Security/' + domainName + '/User/' + userName)
    cmo.setPassword(password)
    Regards
    Makenzo

  • HT1349 How to open unlock for my iphone

    How to open unlock for my iphone

    Are you talking about the slider to unlock your phone or you have forgotten your password to unlock it?
    Or are you referring to unlocking your iPhone from a carrier?

  • Firefox4 always cannot remember how to open these types of file

    When I download certain types of file, for example, .rar file, firefox4 always cannot remember how to open these types of file next time. The check box “automatically use the same method to handle the file” in the download popup window looks grey and cannot be checked. Also, these types never appear in the list of option-application. I check previously installed firefox 3.6, these types are all called (application/***). What’s more, when I want to turn off computer, as long as firefox 4 is opened, it will lose response and prevent Windows from turning off. Whatever I do, reinstalling firefox, deleting profile and even reinstall Windows, I cannot get rid of those issues. I think these are bugs of firefox4. I hope they will be fixed as soon as possible.

    Purchase a legal copy of Windows instead of attempting to pirate it. You will then have the installation disks you'll need and won't have to worry about opening Torrent files.

  • PSE 11 Orgaziner to open with a specific file.

    Like that PSE 11 Orgaziner opens with a specific file, like it did with PSE 9, 6 etc.
    Anybody knows how to do this??

      Are these jpegs? If so make Organizer the default program by right clicking on any jpeg file in one of your folders and choosing.
    Open With >> Choose Default Program >> Browse
    Navigate to:
    "C:\Program Files (x86)\Adobe\Elements 11 Organizer\PhotoshopElementsOrganizer.exe"
     

Maybe you are looking for