Open .doc file in java on Windows 98/2000

Hi all,
I need to open a .doc file on Windows 98/2000 PC thriugh java.I have used the command
Runtime.getRuntime().exec(new String[] {"cmd", "/C", "start", "\"\"", filename});
This command works fine on Window 2000 but gives IO Exception: CreateProcess: start <filename> error=2
So I tried the command
Runtime.getRuntime().exec("start"+filename);
Now this command works fine on Windows 98 but gives the same error on Win2000.
Someone please suggest a command which will work fine on all Windows OS.
Thanks in advance

Have a look at the Java Desktop Integration Components Project https://jdic.dev.java.net/documentation/index.html
especially look at
https://jdic.dev.java.net/nonav/documentation/javadoc/jdic/org/jdesktop/jdic/desktop/Desktop.html#open(java.io.File)
which opens a File using the default application associated with this kind of file.

Similar Messages

  • Opening .doc files from Java

    Ok, here's my problem.
    I'm using Java to create an autorun program for a little thing I'm putting together.
    One of the options should be "Read documentation" . However, to do that, I need to make my program open a Microsoft Word (.doc) document. What is the command/how can I do this? By open, I mean open the file in MS Word for viewing.

    When you say "where filename is the path" do you mean
    type in "\documentation\file.doc" or is it a variable?It's a variable in the example. It doesn't matter -- just as long as the resulting string passed to exec will contain the correct file name so the OS will see it.

  • How can I open a file in a seperate window. for example how can"D:\asd.doc"

    how can I open a file in a separate window. for example how can I view "D:\asd.doc" in ms words window ??

    Check out the Desktop class.
    Edited by: pbrockway2 on Aug 23, 2008 2:20 PM
    There's a detailed example in Sun's Tutorial.

  • How to open KM file in the same window

    When we open KM file by /irj/go/km/docs/... link it is previewed in a new Internet Explorer window.
    We changed Targed property to Self for iView navigation in LayoutSet render but the image file is still opend in new Window.
    How to workaround this?

    We changed Target Window Type property value of ResourceRenderer of Navigation iView  to Self.
    When an authenticated user  tries to open KM file it is opened in the same window if file URL include /irj/servlet/prt/prtroot....
    If file URL contain /irj/go/km/docs/.. it is opened in new window.
    When an anonymous user  tries to open KM file it is opened in a new (popup) window.
    We need that anonymous user can open km files in the same window.
    How to work around this?
    We use light framework.

  • How to display the PPT, PDF, XL, DOC files with in the Windows store app?

    Hi,
    I would like to display the PPT, PDF, XL, DOC files with in the Windows store app? is there any controls provided by Microsoft to view these files with in the app?
    Or
    Any workaround to achieve the desired functionality?
    Kindly provide your inputs if any one has.
    Regards
    Prasad

    Hi Prasad,
    As I know currently there is no in-build functionality to display the PPT, XLS or DOC file directly on the Windows Store App, but you can always open these files by
    Launcher class
    However a good news is we can display PDF on Windows Store App by
    Windows.Data.Pdf class, see this for more information:
    https://code.msdn.microsoft.com/windowsapps/PDF-viewer-showcase-sample-39ced1e8/
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Pages app freezes when trying to open .doc file

    Hello everyone!
    Recently I faced the problem with opening .doc files originally created in Word for Windows in Pages. If the .doc file contains any table, Pages app constantly freezes trying to open it so I have to Force quit it. It happened with few documents containing tables. If the .doc file contains no tables everything works OK.
    I've tried to open files created in Word 2003 and 2007 for Windows. My iWork's version is 4.0.3 (766).
    Can anyone help me please?

    Hi Old-cockatoo
    Welcome to the forum.
    Try altering the format/ing of the original file and see what may be the cause. e.g. Try saving to .rtf.
    Check if there are unsupported features in the Word tables, such as rotated text in cells or a rotated page. Essentially look for variances that could trigger the problem.
    Also look for alternatives to Pages:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=47&mforum=iworktipsn trick
    Pages is not a full substitute for MsWord despite what Apple suggests, implies, hints, intimates, signals, presupposes, infers, signals, says indirectly, gives you to understand… but doesn't actually say if you read the fine print.
    Peter

  • I can't open .doc files attached to the mail.

    After upgrading to the last version (31.6.00); I cannot open .doc files.
    I use Open Office 4.1.1.
    No problem with .xls or .pdf files. But neither the attachments in my sent mails nor the attachments in incoming mails type .doc can be opened by clicking on them. I have to first save to the computer than open the file which takes too much time.
    In the attachment you can see the error message.
    Here is the translation of the message:
    - Top window: File cannot be saved as an unknown error occured. Please retry.
    - Second window - below filename: Error - source mailbox

    Very interesting. It was written for doc type files: "OpenOffice Writer (defined)". (I made a translation maybe it is "default" in English version). Then i make it use another program and choose "Open Office Writer". Now it says OpeOffice Writer but no definer (or default) and it is working. Thank you very much Gnospen.

  • Opening .doc files in pages

    Someone has sent me a .doc word file and when i right click 'open in pages' a window is displayed reading 'the file format is invalid'. It's strange because this has never happened before and we haven't done anything different to what we normally do regarding opening .doc files etc.
    It doesn't open in text edit either. Does anyone have any work around? Free word software anywhere on the internet?
    Really need some help with this, hours of work has gone into this file we can't open!! And now it might be lost!
    Cheers,
    Jamie McIntyre

    moviemaniac2 wrote:
    Really need some help with this, hours of work has gone into this file we can't open!! And now it might be lost!
    The simple soluce would be to ask the author for a document using a format which you will be able to read.
    A message which I like to send is: +"Your xyz.doc document is not recognized as a standard format on my machine so it was deliberately deleted. If you wish that I read it's contents, use an other format. Don't try with PowerPoint, it would be trashed too."+
    Is it too complicated?
    My guess is that the document uses the most recent .doc format. If I'm right, as thisformat was not defined when Pages 3 was built, the described behavior is not surprising.
    I don't know the details of this file format.
    You may send it to my mailbox, I will be glad to look at its internals. (the readable contents is not what I'm interested to.
    Click my blue name to get my mailbox address.
    Yvan KOENIG (from FRANCE jeudi 19 juin 2008 16:37:53)

  • How to open/read file using Java in Unix?

    Hi Friends,
    Can you please help me out how to open/read file using java in unix os? I have create one text file in "/home/test.txt" in unix environment. How to open the same file & read using java code?
    - Hiren Modi

    http://java.sun.com/docs/books/tutorial/essential/io/index.html

  • Easily opening .Doc files

    I use AppleWorks 6.2.4 for virtually all word processing/spreadsheet needs on my iBook. However, my only complaint is how painful it is to open .doc files. At first, if I had a .doc file visible in my Finder, it has a logo of a white sheet of paper. If I double-clicked on it, Finder would tell me that it couldn't find an application to open the file, and would not give me the option to choose.
    The only way I found to open them is to
    1. Launch AppleWorks.
    2. Click File > Open.
    3. In the File Format drop-down menu, scroll ALL THE WAY down to "Word Win 97, 2000 [MacLink AW]"
    4. Navigate to and select the .doc file...... at which point the MacLink Plus conversion progress meter appears, and viola. open.
    This is all fine and dandy, but I thought "this has to be easier. Why can't I just double-click on the dang file in the Finder?"
    So, I found a control panel called File Exchange that looked promising. Under the PC Exchange tab, I looked for the PC Extension called "doc." The application selected for it was "AppleWorks," but the logo was a picture of a hand on a piece of paper. So, I highlighted it, and chose "change." In the next window, I selected AppleWorks 6 (with the actual logo next to it." I then clicked "OK."
    Now, each time I open a .doc file by double-clicking on it in the finder, it opens an AppleWorks speadsheet, with some jibberish in the first cell -- that's it.
    The old method of opening it is still successful -- I've finaggled with the File Exchange control panel, on virtually every setting I could come up with, and nothing seems to work.
    Any ideas?

    Hi, sopranojam85 -
    In the File Exchange control panel, the PC Exchange tab info governs what happens to a file that is imported to the machine, i.e., one that is either downloaded or is copied from another (usually temporary) volume. The info on the File Translation tab is used when handling files already on the drive. When a file does not have a Creator code that matches a program available to the OS, it looks in File Translation for a match, and uses that if so instructed by you - you can set File Translation to not display a choice if there is only one possibility.
    The term "Word Win 97, 2000 MacLink AW" indicates you have the version of MacLink that came bundled with AppleWorks.
    I'm running the same version of AppleWorks as you are, however I have added the commercial version, MacLinkPlus Deluxe, which provides a broader range of file translation capability with AppleWorks. It still won't provide a direct double-click-and-open function, because I have more than one choice (AW 5 as well as AW 6), but when I do double-click a .doc file the File Translation intercept window opens and offers me the choice of AppleWorks 6 with MLP translation.
    Using the Open menu item within AppleWorks 6, if I let the Format pulldown menu stay at "AppleWorks", a .doc file will not be displayed in the scrolling list; but if I change the Format pulldown to "All Available", it does display .doc file types - this is a lot faster than scrolling down a long ways.
    The method I actually use for most non-AW file types is to keep an alias to AW6 on the desktop, then drop the non-AW6 file onto the alias - this works pretty much the same as the result of using an Open command within the application, and works even if AW6 has not yet been started up.
    Note - sometimes an alias to AppleWorks 6 won't work quite right. This is a result of the AW6 program (the one you see) actually being an "application program package", or Package, which is indicated by the ".app" suffix on the AW6 name ("AppleWorks 6.app").
    A Package is a specialized folder - it looks like a program, and acts like one when you double-click on it; but it's actaully a folder. Typically, in that folder are more than one version of the program (for example - one for OS 9, and one for OSX), plus additional support files.
    Although Finder understands packages, sometimes it screws up - especially when dropping a file onto an alias to the package. What happens then is that Finder, for some reason, treats it as a folder alias, and dutifully deposits the dropped file into the folder - into the package itself.
    Such files are recoverable - quite easily, too. To open the package, with the program not running and Contextual Menus active, Control-click on the package (the program itself, not the alias) - one of the items that will appear in the contextual menu that opens is Show Package Contents. Select it, and the package will turn into a folder, which opens automatically. Retrieve your "lost" files - just drag them out onto the desktop.
    While you're there, locate the OS 9 version of the program (in AW6 it is in a sub-folder in Contents named MacOS Classic), and make a new alias of it. Then replace the alias you've been using (which is actually an alias to the package, and not to the program) with the new one. Doing so should prevent a recurrence of the problem.
    Once you've done what you need to, close the .app folder - its icon should have a small image of a brown parcel (a "package") superimposed on it. Control-click on that folder and select "Hide Package Contents" from the contextual menu.

  • Opening .NEF files in PS3 on Windows XP

    I cannot open my .NEF images in my PS3 that I took on my Nikon D7000.  I am trying to convert them to .jpeg and I have tried to open them in Bridge and I have also tried to convert them to .jpeg through tutorials I have found telling me to use the image processor tool in Photoshop.  I cannot even see/view the images in Bridge and when I go to convert them to .jpeg, it tells me it cannot be done.  I am new with shooting in raw and I have always shot in .jpeg, so this is all so new to me.  I am not sure if all of my programs are way too outdated to be able to do this, including my operating system (Windows XP).  Shouldn't it be possible for me to open these images and convert them to jpegs?  Is there an update I need to download, or something, to make this work?  PLEASE HELP! 

    Thank you for your reply.
    I i can drag & drop a website from Firefox on Mac onto my desktop and reopen it in Firefox in Mac AND Safari Browser, why i cannot open them in Firefox on Windows.
    I can drag and drop URLs from Firefox on Windows and reopen them
    So what's so wrong about adding support for these kinda files making them work vice versa?
    I'm working this way because it's easier and faster and more organized for many reasons when exchaning URLs.
    Reason 1.: (keep things organized and in focus)
    If i send somone many many web documents (research), there is much more information at first sight, rather than copy pasting the URLs itself plus having to add a description to every URL.
    For example this particular page here where we are on it describes itself in the web document name:
    ''' opening .webloc files in Firefox on Windows Firefox Support Forum Firefox Support'''
    read it > double klick > open in browser tab > done
    or else
    '''https://support.mozilla.com/en-US/questions/761091'''
    if converted to text only (e-mail, etc.) then i have to > mark url > copy/paste > add in browser.
    Understandable?
    But, hey, there is no reason for a reason because there are so many reasons. Fact is that a file which was created from Firefox should work Cross Plattform.
    Or du you think i will stay with the external "webloc2url" Perl Script Application forever dragging webloc files from FF on Mac one by one?
    If there is a single person who can write a Perl Script application converting/re-writing webloc files to correct URLs and open them without the hassle, why a company like mozilla can't do implement the code into FF?
    Go and Google all the complaints about webloc files from Mac.
    I mean, ehm ...

  • Problem with opening doc. files in pages '09

    Hello, can anybody help me, ever since i installed " snow leopard" v10.6.2, pages '09 doesn't open doc. files ( word ) anymore.
    Even documents produced in pages en ""saved as" a word document can't be opened again.
    Keep receiving pop up whit message " can not be opened"
    Yves
    Message was edited by: deschutter

    You need to manually install the 10.6.2 "Combo" version, there were problems with just using the regular update.
    See:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=153&mforum=iworktips ntrick
    Peter

  • Can't open doc. files in pages

    Ever since I upgraded to Snow Leopard, Pages won't let me open doc files.
    Is there a way I can fix this?
    Also...I was just thinking about upgrading to the newer iLife09.
    Would that be a better thing to do running Snow Leopard and what not?
    And if I do upgrade to iLife09, I'll still be able to open iLife08 documents.
    Thanks
    -Nathan Rojas

    Nathan Rojas wrote:
    Ever since I upgraded to Snow Leopard, Pages won't let me open doc files.
    Is there a way I can fix this?
    Also...I was just thinking about upgrading to the newer iLife09.
    Would that be a better thing to do running Snow Leopard and what not?
    And if I do upgrade to iLife09, I'll still be able to open iLife08 documents.
    Thanks
    -Nathan Rojas
    iLife & iWork are two separate software packages/suites sold by Apple. I do believe you mean iWork '08.
    Many users are finding problems with the iWork apps in Snow Leopard due to not having the latest updates as of the September 28 installed. For iWork '08 that is Pages 3.0.3 & Numbers 1.0.3. For iWork '09 it's Pages 4.0.2 & Numbers 2.0.2. iWork '09 has since had update 3. I don't use Keynote, but it should also be updated. If you're not running the latest versions & Software Update says your software is up to date, make sure the applications are where the installer initially put them. The updaters are very picky. If the location is not where the updater is programmed to look or if the folder doesn't have the name the updater looks for, it will not work. The applications cannot be renamed or moved. They must be in the iWork '08 or iWork '09 folder in Applications. That iWork folder must be named iWork '08 or iWork '09. If it doesn't have the '08 or '09 Software Update won't find them & the updaters won't work.

  • Opening image files in their own windows in PS4

    Before PS4, I could open image files in their own windows. In PS4, when I want to open more than one file, these open with tabs and any new file I open is added to the tab queue. It is annoying to right click on each tab so each file is in its own window. Is there a universal preference to change this annoying behavior?
    Using a Windows environment with Photoshop CS4 Extended.

    see the tabs setting in the preferences. you can turn that off.

  • Choosing Default Program for Opening .doc files

    Hi all,
    A couple of days ago I somehow managed to change my default program for opening .doc files to Pages and I would rather use Microsoft Word as the default. I dont know how I ended up changing this default, but I would like to know how to put the default back to MS Word.
    Thanks for any help!

    Choose any one of the files you want to change. Then, command-i to "Get Info". Open the disclosure triangle under "Open With" choose "Microsoft Word" then click on "Change All".
    -mj
    [email protected]

Maybe you are looking for