I need to open a file with an associated programm.

I need to open a file with an associated programm.
I'm looking for two solutions:
1. for Linux/Solaris/Unix/...
2. for Windows 95/98/Nt/2000
For Windows I have done this with command line
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + uSavePath);
but it doesn't work on windows2000. We need an universal solution.
For linux
Process p = Runtime.getRuntime().exec("netscape openURL " + uSavePath);
But may be anybody know better solution?

You are right. For unix better solution is that my program to care about all association itself. As I undestend now it's a common solution for unix applications.
But for windows it will be ugly enough. I've found another way for windows
Win2000/NT: "cmd /C start filename /B"
other Wins: start filename
for linux I've stopped at doing this via Netscape.
May be in future I'll make my property file.
start filename - on Win95(may be 98/ME) returns -1 if file not assotiated with a programm, and doesn't shows openWith dialog. It solved using something like "rundll32 shell32, OpenWith filename"
It's all for those how will solve this problem in future.

Similar Messages

  • Opening a file with an associated application

    Ok, I have a project where I have to open a file or files
    with the associated application on a local system. I have tried the
    "open" command in lingo, the "ApplicationXtra.x32" xtra, "BuddyAPI"
    xtra and the "FileXtra4" xtra. Each will open the application but
    none will open the file path and name sent in the argument;
    assuming any of the folders in the path or the filename itself has
    spaces in it.
    Here is an example of the code used for the lingo "open"
    command:
    open "E:\Working\PlotViews for Cleveland.dwg" with
    "E:\Program Files\ACAD2000\acad.exe"
    Here is an example of the code used for the
    "ApplicationXtra.x32":
    RunApp = new(xtra "ApplicationXtra")
    RunApp.RunApp("E:\Program
    Files\ACAD2000\acad.exe","E:\Working\PlotViewsforCleveland.dwg")
    Here is an example of the code used for the "BuddyAPI":
    ok = baShell( "open", "E:\Program Files\ACAD2000\acad.exe",
    "E:\Working\PlotViews for Cleveland.dwg" , "E:\Working\", "normal"
    And here is an example of the code used for the "FileXtra4":
    FX = new xtra("FileXtra4")
    FX.fx_FileRunApp("E:\Program Files\ACAD2000\acad.exe
    E:\Working\PlotViews for Cleveland.dwg")
    All of these crap out when there is a space anywhere in the
    path or filename. Can anyone point me in the right direction?
    Thanks for the help.

    Well, to anyone who cares....I used the ShortFileName
    function from BuddyAPI and BAM it works!

  • I cannot open PDF files with my Mountain Lion system. What APP's do I need?

    What Apps do I need  to open PDF files with Mt. Lion installed?

    Double-click the PDF and it should open in Preview.

  • What version of GB is needed to open .band files created in GB for the iPad. I am running GB '08 on my desktop PPC G5 with OS X 10.5.8, so I can't go to GB '11. Any solution?

    What version of GB is needed to open .band files created in GB for the iPad. I am running GB '08 on my desktop PPC G5 with OS X 10.5.8, so I can't go to GB '11. Any solution?

    jerryfromtorrance wrote:
    What version of GB is needed to open .band files created in GB for the iPad.
    6.0.2
    jerryfromtorrance wrote:
    I am running GB '08 on my desktop PPC G5 with OS X 10.5.8, so I can't go to GB '11. Any solution?
    although i ran GBX6 under 10.5.8, i do believe an intel processor is required. that means that the only complete solution would be a new computer, i'm afraid.
    the best you could do is export each track as an audio file from GBi and drop them into your GBX project

  • I am unable to open files on amything!!! a box pops up that asks me what do i want to open the file with..every time!! I want files to open when i click on them!! This happens with emails, websites, everything

    I try to open attachments in emails and they will not open! A box comes up asking 'what do I want to open the file with', and it wants me to select from a list of options like - Firefox, IE, Word, Yahoo Browser. When I make a selection (usually Firefox) a new tab opens with a blank page! This always happens on attachments, links, websites......everything!

    These files were lost two years ago.
    That's not consistent with what you wrote in your first message. I can't help you unless I know what's going on. Either you do, or do not, have backups of all the data you want to keep. If you do not, then the first thing you need to do is back up those files. It makes zero sense to do anything else. In order to back up, you'll need either of two things: another Mac, in working order, with a FireWire port and enough space on its internal drive to hold your files; or an external drive, also with enough space.
    On the other hand, if you do have backups, or if you simply don't care about any of the data, then the solution to your problem may be quite simple. All you have to do is boot from your installation disc (your profile says you're running Mac OS 10.5), erase your internal drive, reinstall the Mac OS, then restore your data from backup. You will need to be selective in restoring software, because incompatible software may be what caused the issue.
    But it's also possible that you have a hardware failure, in which case you can't get your computer working again until it's repaired.

  • How to open a file with a link ?

    I am using servlets to design an application.
    The application supports uploading and downloading of .DOC and .RTF files.
    My problem is that I am opening an uploaded file via a link.
    OPen File
    The above is also working fine and opens the file in the IE browser.
    But my problem is that I want to open the file with MS-Word...as is done on many resume-building websites.
    1) How am I supposed to do that ?
    2) Can I specify ContentType="application/msword" in a link ?
    Please Help !!

    I did the foll. w.r.t a docbase.
    A docbase stores documents and assigns an unique id to each one. The foll. is a code snippet that opens a document's contents in a browser.
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    Connection conn = null;
    Statement stm;
    ServletOutputStream sos = null;
    ResultSet res;
    // .... get id of document u want to open
    query = "select id from .. where object_name = ' xx' .."
    res= stm.executeQuery(query);
    Blob blob = res.getBlob("_content"); // this will get content of document identified by id
    int blobLen = (int)blob.length();
    //the foll. is the part u need..
    if (blobLen > 0) {
    InputStream contents = blob.getBinaryStream();
    response.setContentType("application/msword"); // MS Word
    byte[] buf = new byte[blobLen];
    int length = -1;
           while ((length = contents.read(buf)) != -1){
              sos = response.getOutputStream();
              sos.write(buf,0,blobLen);
    sos.flush();
    System.out.println("Doc Received");
    contents.close();
      res.close();
      conn.close();
    }

  • I can't open PDF files with adobe flash player

    I have installed it and whenever I try to open pdf files it says I need to agree with your liscens and you do that automatically when you download it. I have followed all your instructions on your website and uninstalled it and installed again, but I can't open pdf files with it. I don't know what the problem is exactly, but it's really frustrating..

    Flash Player CANNOT open PDFs because they AREN'T Flash Documents.
    Adobe Reader opens PDFs.
    To accept the license agreement (NOT the one you accepted to download or install - the one for USE)
    Windows:
    Go to: C/Program Files(x86)/Adobe/Reader 11.0/Reader and double click the eula.exe file. The license agreement will open for you to accept.
    Mac:
    Go to: Mac HD/Applications and double click the Reader app. The license agreement will open THE FIRST TIME you open it.

  • Issues opening RAW files with CS2...

    I find if a bit complicated to open RAW files with Photoshop CS2 in iPhoto 08 (I'm using OS X 10.5). Currently the only way I've been able to do this is do a search for the file name in the finder, at the bottom of the Finder window, in the path, double click on the folder that the RAW files are in (user/my name/pictures/iphoto library/originals/2007/RAW files), then highlight the NEF files (the cameras a Nikon D200) I want to open, hit command/O then Photoshop CS2 opens the files in the RAW converter. If I try this from CS2 (command/O) the path goes as for as iphoto library (user/my name/pictures/iphoto library), at this point the iphoto library icon is ghosted out and can not be opened. If I drag and drop the image from iPhoto to the CS2 icon in the dock it opens as a jpg not the RAW file I need. If I try clicking my way to the folder from the left side of the finder, my name/pictures/iphoto library this is as far as I can go. There's something strange going on here. How can you go to a folder only one way and not the others? There seems to "hidden" folders now.
    So... My question (finally), how can I simply open RAW files from iPhoto 08 in CS2?

    In iPhoto's Advanced preferences select the checkbox under RAW Photos: "Use RAW when using external editor". That will open the Cr2 file in the raw editor. To get the edit to show in iPhoto you'll need to click on the Open Image button so the jpg version is created with the edits you made to the RAW file. Then when you save you'll need to navigate in the Save window to the Modified folder and save it into the folder representing the event that the original is in. It's not easy. I've not done much with RAW, just a few tests, so there may be an easier way to get iPhoto to recognize the edited version.
    If you don't use the Open File and close iPhoto won't display the edits you made to the RAW file.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Cannot open pdf files with Firefox's built-in pdf viewer

    This just started (I think) with Firefox 37.01. This is on Win7-X64. I cannot open pdf files with the Firefox built-in pdf viewer. If I click on the file or try to open it from within Firefox, it brings up a "opening filename.pdf" message. If I select the "Open with" radio button as 'Firefox (default),' it just keeps looping on this process; it never opens. In Tools => Options => Applications, Portable Document Format (PDF) is indicated as 'Preview in Firefox.' I've never had any other PDF viewer installed on this computer. I've tried disabling all plug-ins and extensions, but it still doesn't work. I searched for solutions but haven't found any for this specific issue.
    Thanks for the help.

    Hello,
    Have you tried, to start Firefox in safemode you can do so by following these steps
    '''If Firefox is open,''' you can restart in Firefox Safe Mode from the Help menu:
    * Click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    '''If Firefox is not running,''' you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".
    ;[[Image:SafeMode-Fx35]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, theme, or hardware acceleration. Please follow the steps in the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • Is there any photoshop API functions can let me open a file with photoshop in my plugin?

    I used  the function system("open file"), it works well in any other program.
    For example, system("open 1.psd"), this code can use photoshop open the file 1.psd .
    But it just don't work in my plugin program.
    How can I use photoshop to open a file in filter plugin at Mac OS X?
    Is there any photoshop API functions can let me open a file with photoshop in my plugin?

    Go to settings> general and scroll down to multitasking geastures, turn them on and by swiping with four fingers from the right side of the iPad to the left and back you can switch between apps. I think this is what you need I'm not sure, I hope it helps

  • Mac opening exe. files with Captivate 5

    I am a Mac user and need to open exe. files from my lecturer. I have got Captivate 5 and have updated it with the patch BUT nothing I seem to do enables me to open the files. Can anyone please help? 

    Hello,
    MAC will not open .exe files as .app is the extension for MAC Executable files, or if you want to install an application on MAC, you can use .dmg format
    Thanks

  • Hi, I have a version of CS4 on my Mac.  I can not longer open Raw files with it from my Canon 5D.   I never had problems with it in the past.  What can I do?

    Hi, I have a version of CS4 on my Mac.  I can not longer open Raw files with it from my Canon 5D.   I never had problems with it in the past.  What can I do?

    is that the eos 5d?
    if so, you only need cr 3.3 or greater.  what version do you have in your cs4? (help>about plugins>camera raw)
    if you need to update it, http://www.adobe.com/downloads/updates/

  • Cannot open TDM files with compiled applications

    I need to open TDM files using my EXE application, but it doesn't work in computers with only LabView Run Time installed. (It does if LabVIEW is installed, and it also does if I run my VIs). It doesn't display any error, and it doesn't extract any data.
    I've tried installing DSC Run Time as well, but it doesn't work either.
    Is this some Lisencing restriction?
    Do I need some extra installings?

    Regardless of the forum location ... make sure you have checked "NI USI" in your installer build specification.
    Herbert

  • When I open .txt files with firefox all underscores disappear. How do I fix this?

    I have a list of websites in a .txt file and they all contain underscores. When I open the file with firefox all underscores turn into spaces, so that the links don't actually work.

    Can you post a short excerpt of this text file?
    Note that you usually need an extension to open links in a text file via a left-click with the mouse.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Windows has the following information about this file type. This page will help you find software needed to open your file. Cannot get SEO quale loaded please help

    I cannot download as I keep getting this when I try
    Windows has the following information about this file type. This page will help you find software needed to open your file.
    File Type: Firefox Browser Extension
    File Extension: .xpi
    Description: Compressed archive of primary file installation components – used by the Mozilla installer script to setup and install various applications. You may search the following Web site for related software and information:
    Please advise how I go about downloading

    despite the workaround, it doesn't fix the real problem. It shouldn't be a huge deal for adobe to add support for multiple svn versions. Dreamweaver is the first tool i've used that works with svn that doesn't support several types of svn meta data. If they're going to claim that Dreamweaver supports svn is should actually support svn, the current version, not a version several years old. This should have been among the first patches released, or at least after snow leopard came out (and packaged with it the current version of svn).
    does anyone know if the code that handles meta data formatting is something that is human readable, or where it might be, or is it in compiled code.
    i signed up for the forums, for the sole purpose of being able to vent about this very frustrating and disappointing situation.

Maybe you are looking for

  • Hide ribbon in Sharepoint Foundation 2013 for visitors group

    Hello, I'm looking for a way to hide the ribbon in Sharepoint Foundation 2013. In this forum I can find many ways to do it but every possibilities are for Sharepoint 2010 or Sharepoint 2013 and not for foundation. Also if I want to change the .html m

  • Unable to load camera raw plug-in update.

    My Photoshop version is 12.0.4 x64 - when I run update it shows "up to date". When I try to install the plug-in it tells me to contact support. Why can't I install the updated plug-in?

  • Messed up albums in itunes

    I have my itunes set so the songs are grouped with the album art. for some reason, sometimes when I upload an album it gets broken up into different parts. For instance, when you click on an album it'll show tracks 1-2 with the album artwork, then th

  • How to provide credentials for outbound HTTP connection

    Hi all, My outbound request requires basic authentication How to provide credentials within xsjs for outbound request. My .xshttpdest file has authType=basic: host = "host"; port = 80; description = "decription"; pathPrefix = "/geoserver/"; authType

  • Jyhton issue with ODI upgrade

    Hi, I am trying to execute the jython script but when i execute this part d = glob.glob(src + os.sep + 'd33*cts.txt') i am getting the following error :Traceback (innermost last): File "<console>", line 1, in ? AttributeError: class 'org.python.modul