"Open With" dialog when getRuntime().exec fails

Hi,
I have a program that I use to open media with the associated program on the client machine.
Process p = Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL " + file);
But when there is no associated program with the file extension I want to open the "Open With" dialog on the client machine.
Process p = Runtime.getRuntime().exec("rundll32 SHELL32.DLL,OpenAs_RunDLL " + file);
How do I intercept and not show the error dialog appearing when getRuntime().exec can't open the file, so I can run the command above instead?
Best Regards,
Anders

I tried
Process p = Runtime.getRuntime().exec("start rundll32 SHELL32.DLL,ShellExec_RunDLL " + file);
got exception
java.io.IOException: CreateProcess: start rundll32.exe SHELL32.DLL,ShellExec_RunDLL C:/JBuilder9/doc/Productivity User Manual.pdf error=2
     at java.lang.Win32Process.create(Native Method)
     at java.lang.Win32Process.<init>(Win32Process.java:63)
     at java.lang.Runtime.execInternal(Native Method)
     at java.lang.Runtime.exec(Runtime.java:566)
     at java.lang.Runtime.exec(Runtime.java:428)
     at java.lang.Runtime.exec(Runtime.java:364)
     at java.lang.Runtime.exec(Runtime.java:326)
     at BrowserControl.displayURL(BrowserControl.java:47)
     at BrowserControl.main(BrowserControl.java:123)

Similar Messages

  • How can I open Elements 8 with "Open with dialog" in Windows XP?

    When I try to open a photo from My Pictures using the Open with dialog (when I click on Register) I get a message"Specified file is missing! No changes were made"   Photoshop Elements 8 is installed and working. For some reason Adobe Photoshop Elements 8 no longer appears on the list of programs in the Windows Open With dialog. How can I add Adobe Elements 8 to the Open With dialog?  There are programs listed that I do not use. Is there a way to delete or add programs to the Open With dialog?

    I couldn't get this to work for some reason. I solved the problem by
    downloading
    OpenWithAdd_1.2.zip.   This adds the program to the "Open with dialog"
    The procedure is:
    Download OpenWithAdd.zip and run it. Locate the application that you
    want to add to the Open With dialog.
    Type the command-line parameter (if the application requires one) in the
    appropriate text field. And optionally, you can give a personalized name
    for the application which you're trying to add to Open With. This text
    will appear in the Open With dialog, describing the application.
    Once done, click Register.
    Your application is now added to the list.
    Bob Ennis

  • How do I clean out the "Open With" dialog box when I right click an image?f

    Hi,
    When I right-click and image to open it in a program I get a long list of programs to choose from. Many are duplicated or the same program but different version #s like Preview. How do I clean out the dupes and ones I don't want and keep the ones I do?
    How would I add CS3's Adobe Camera Raw to the list?

    Do a search for details on cleaning up the "open with" dialog, it's been discussed before but I'm sorry I can't remember what the fixes are.
    I have duplicate choices too but have never tried to clean them up.
    Regards,
    Steve M.

  • "Open with" dialog repeat itself 4 times

    I've got a very strange problem with the finder - when I use the "Open with" dialog to choose another application to open a file (the filetype does no matter) the dialog repeats itself four times (you can see it here: http://de.tinypic.com/r/292xutv/4).
    This just happened if I use the keyboard to switch to "Open with" (right click with the mouse on the file, arrow down to the "Open with" dialog, arrow right), if I use the mouse all the time (right click, move the mouse to the dialog, ...) there was no problem and the applications only where listed once.
    I've tried - and this don't solve the problem:
    * Log in with another user account
    * Delete ~/Library/Preferences/com.apple.finder.plist (and reboot)
    * Run +/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Launch Services.framework/Versions/A/Support/lsregister -kill -domain local -domain system -domain user+
    I hope someone can help me and solve the problem.
    Thanks!

    You only tried deleting LaunchServices from your user, try it systemwide. They are only cache files and can do no harm...
    Launch /Utilities/Terminal and copy & paste this at the command line to rebuild LaunchServices:
    Code:
    <pre class="alt2" style="margin:0px; padding:3px; border:1px inset; width:640px; height:34px; overflow:auto">/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user</pre>
    Then press return. Wait until terminal returns to the command line. Quit Terminal. After that, log out and back in or restart. Let us know
    -mj

  • Remove applications from 'Open With' dialog

    I have searched seemingly everywhere for an answer to this question. When I right click on an html file (or really any other file) and to go the 'open with' dialog there is a huge laundry list of applications listed. For the html files there are DivX converters, Big Bang games, etc.
    How can I remove all of the applications that I know can not open an html file and others that I would never use to open those files either? I like the ability to easily open the file with different browsers but really dislike scrolling through 30 different applications to find them.
    I have deleted the "com.apple.LaunchServices" file and rebooted.
    I have run "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServ ices.framework/Support/lsregister -kill -r -domain local -domain system -domain user" and rebooted.
    Neither of these solutions are helping the problem at all. I even tried some Onyx program. Is there a way to "trim the fat" from that window?

    The command you ran "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServ ices.framework/Support/lsregister -kill -r -domain local -domain system -domain user" is for 10.4, it is not the correct command to rebuild LaunchServices in 10.5.
    Launch /Utilities/Terminal and copy & paste this at the command line to rebuild LaunchServices:
    Code:
    <pre class="alt2" style="margin:0px; padding:3px; border:1px inset; width:640px; height:34px; overflow:auto">/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user</pre>
    Then press return. Wait until terminal returns to the command line. Quit Terminal. After that, log out and back in or restart. That should solve it. Let us know
    -mj

  • Two "Open with" dialogs by insert a Video DVD [Solved]

    Hello,
    always when i insert a video DVD i became two "Open With" dialogs.
    I have no Fstab entry for the drive.
    Thanks for every answer.
    Last edited by ZeroCool (2009-10-12 21:07:09)

    No i haven't  any udev rule for the drive
    [Update]
    This Bug is fixed in gnome 2.28
    [Update]
    I found out that this is a (old) Bug
    http://bugs.archlinux.org/task/13138?st … &project=1
    Last edited by ZeroCool (2009-10-11 17:59:54)

  • IPhoto will not open with pictures when I click on the icon.  It does show that it is open on top toolbar. What happened to my photos?

    iPhoto will not open with pictures when I click on the icon.  It does show that it is open on top toolbar. What happened to my photos?

    Did you run any updaters recently, i.e. like just before this happened?  Try this first fix: make a duplicate copy of the library and try the following:
    1 - delete  the iPhoto preference file, com.apple.iPhoto.plist, that resides in your Home/Library/Preferences folder. 
    2 - delete iPhoto's cache file,, Cache.dbt, that is located in your Home/Library/Caches/com.apple.iPhoto folder. 
    3 - reboot, launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences..
    OT

  • How to add Photoshop CC 2014 to the "Open With" dialog?

    Hi!
    As mentioned in my previous dialog. THe new Photoshop CC 2014 does not appear as programm in my Open With dialog, so I tried these steps:
    Double click on a NEF or PSD file
    Select a program from a list of installed programs
    Checked again "Other programs": No Adobe Photoshop CC 2014 at all
    Click on "Browse"
    Select "C:\Program Files\Adobe\Adobe Photoshop CC 2014\Photoshop.exe"
    But it is NOT added to the Other Porgrams list, so I'm still not able to open it with Adobe Photoshop CC 2014
    Sorry, but that is really annoying now.
    Has anybody any idea how I can solve this issue?
    I trust the volunteering users here more than Adobe itself. So far I've no good impression since the CC story. Before CC I was never forced to use this forum. Also I got only working solutions by other user almost never by Adobe itself. :-(
    Thanks!

    I found at least a workaround in Bridge:
    Open Bridge
    Edit -> Preferences -> File associations
    Select the file type you need
    Click on "Photoshop"
    Select "Search"
    Select "C:\Program Files\Adobe\Adobe Photoshop CC 2014\Photoshop.exe"
    Repeat the steps beginning with 3. for each file type you need
    But this only for Bridge itself. I'm still not able to open my file in File Explore. Also I've to do these steps for each file type manually.
    But at least it's working now in Bridge, but that is only a workaround, as I changed only some file associations manually. That must not be the solution.
    Any idea how to fix this issue?

  • Removing Open With dialog from contextual menus

    Does anyone know how to remove the "Open With..." option from contextual menus?
    Thanks

    musicwind95 wrote:
    What are you trying to do?
    I'm hoping to find an option to remove the Open With dialog which I never use. If I right click on a simple JPEG to move it to the trash and happen to land on the Open With dialog it takes almost ten seconds to populate the dialog before I can move off of it. It is a consequence of having, and using, hundreds of applications. I'm also an extensive user of contextual menus. I get stuck with that unexpected delay numerous times each day. It is annoying.

  • [pcmanfm] Open with dialog empty [solved]

    Hi there,
    I am using the latest pcmanfm-git built from the AUR.
    Can someone confirm that the open with dialog window is empty?
    Screenshot: http://i.imgur.com/qnV6B6o.png
    Last edited by orschiro (2014-05-12 05:15:12)

    Tested the normal version of pcmanfm. The result is unchanged. The open with is empty.
    It is fully working in Thunar strangely.
    Any other ideas?

  • Lightroom 5.0 fails to automatically open import dialog when memory card inserted

    Lightroom 5.0 fails to detect memory card and open import dialog. This has always worked fine in Lightroom 4, 3,and 2.  Same cards, same camera, same iMac using OS X 10.8.4. Manual importing works OK, card is detected just fine.

    I have tested Lightroom 4 and Lightroom 5 on Mac OSx 10.9.4 and find no difference in behavior.
    If you have correctly set Image Capture to auto-launch Lightroom on insertion of card and you have set Lightroom to launch the Import dialog upon insertion of card, this is expected behavior:
    1. If Lightroom is not open open, inserting a Memory Card will launch Lightroom without opening the Import Dialog
    2. If Lightroom is open already, inserting a Memory Card will open the Import Dialog.
    I can find no combination of settings in Lightroom 4 or 5 that allow you to, with Lightroom closed, insert a card and have Lightroom launch and open the Import dialog. I would sure love to see someone produce a screen vid capture of Lightroom 4 opening by itself and launching an import dialog upon card insertion with no user intervention.

  • Javascript to add "Specify Open Preference" dialog when linking with "Go to a page view"

    Hi, all!
    We're needing to file a brief with the Court.  Within our .pdf brief, we link to exhibits and transcripts.
    For the exhibits, we hyperlink using "open a file," because going to the first page of the exhibit is fine.  Here, after selecting our file, we're given the "Specify Open Preference" dialog, where you can either (a) go with the user's setting, (b) mandate opening the link in the same window or (c) mandate opening the link in a new window.  This is perfect -- we always want a new window.
    However, for the transcripts, we need it to go to a particular page, so we use "Go to a page view."  This works fine, except that it ALWAYS and ONLY goes with the user preference.  We want it to ALWAYS and ONLY open in a new window, so the Court can close the destination and be in the same place in the Source doc.  I realize they can set their preference or use "return to previous view," but we can't really communicate that.
    Is there a javascript -- or a plug-in we can purchase -- or anything -- that will somehow allow us to fix "Go to a page view" to open in a new window?
    Thank you so much for your thoughts and help!
    --ak

    After creating a "Go to page view" type link you can go back end edit it and specify how you want the other document to open:
    I realize this is a bit tedious, but that's how it's done.

  • How do I restore my tabs and windows, whether open or closed, when everything else fails?

    This is not so much a question, as an answer that some people desperately need.
    Ever since Version 34, Firefox has done a superb job of restoring the tabs that the user has created, either on restarting Firefox (if that option is chosen) or on request.
    The details of how to restore tabs are covered in Firefox's basic help online, and even how to deal with several crashes in a row (such as in an addon) ruin the normal backup file are also well explained.
    However, today I accidentally pressed Alt+F4 twice on my poorly-designed keyboard and closed my main window, with 93 tabs, and another Firefox window as well. I'm not sure this is exactly what happened, but I lost all 93 of my tabs.
    I read many of the postings in which people give various suggestions, but none worked. Every time I restored a version of the sessionstore.js file I saw the same lonely empty tab. Restoring prefs.js did nothing, and neither did making changes in the internal configuration constants.
    I tried refreshing/resetting Firefox (which preserves bookmarks), but I still couldn't restore the tabs. It was now clear that the problem was in sessionstore.js (and all its backups) for sure.
    I'm writing this for people who must restore their windows or tabs, and don't mind getting technical about it. That was my situation.
    The solution was to realize that the sessionstore.js file contains JSON code, which is an efficient way to represent integers and strings arranged in a tree structure.
    I figured there must be a JSON editor somewhere, and it turns out there is a great one available online, at www.jsoneditoronline.org . It can read a file on your computer, edit it, then save it back on your computer.
    As soon as I viewed sessionstore.js in the editor, it was obvious how easy this was going to be. The top level of the tree is understandable. I simply grabbed the data representing the window with 93 tabs, and dragged it from the list of closed Firefox windows to the list of open windows. This automatically moved the history of each tab, and even the strings entered into forms.
    After copying sessionstore.js back to the Firefox profile, I started Firefox one more time. The playing of Pandora signalled that my tabs were back and functioning once again.
    Now, editing JSON code is not something that everyone is ready for. And your problem might not be reflected in the JSON tree so simply. But, for technical-minded people who don't want to lose their tabs or windows to a mistake or a crash, this technique can be just what's needed when everything else fails.

    That sounds very handy. Nice going. A kind of backup would be to
    create a folder in the Bookmarks Manager, and keep a list of links there.
    Just one note. The sessionstore file shows the last windows / tabs that
    are open. Because the window with the 90 tabs was closed first, then the
    other, that is what caused your issue.
    Please edit the post title by adding '''==Solved==''' to it. Others may think
    you are asking for help, not offering a solution.

  • Why do i get an "open with" box when i try to start screen saver?

    I have an Hp a6120n PC.  When I try to install a screen saver, I get a dialog box that says open with and gives a series of suggested programs to use to open the screen saver. The same thing happens when I try to download a program from the internet. What can I do? Also, I would like to wipe my hard drive and start over. Is there some way I can do that? I am not ver computer literate so please try to explain so I can understand. This is my first computer and I bought it from my Daughter so I want to take all her information off of it.

    Hi
    Please find the link given below might help you to do a recovery please note all the data on the unit will be lost hence back up data before performing a recovery.
    Performing an HP System Recovery
    Let us know how it goes!
    "I work for HP."
    ****Click the (purple thumbs up icon in the lower right corner of a post) to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    Regards
    Manjunath

  • How can I change the default "file type" in the open file dialog when using Firefox on certain web pages?

    I work for a bankruptcy attorney. We use the Court's file upload to file our documents. When I am on the Court's site and I have to pick a file to upload, the "open file" dialog box pops up. In Firefox, the default "file type" is always "image" files. I need it to be "all files". How can I change this setting?

    Two observations.
    First — "Tools-> ...." is specific to Acrobat X and XI. It did not exist prior to Acrobat X.
    Second — Acrobat 9 Pro / Standard (nor earlier release) does not support viewing a PDF page containing a scanned image and performing a right-click  ... Save Image As. 
    The context menu provided by Acrobat 9 Pro with a right-click on a scanned image is:
    The context menu,from a right-click with the TouchUp Object tool selected, for Acrobat 9 Pro is:
    So, to paraphrase what Paul Harvey used to say ... What's the rest of the story?
    Be well...

Maybe you are looking for