Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2008
    Posts
    1
    Rep Power
    0

    Default Error during file open

    <CODE>
    String file = "C:\\Documents and Settings\\mit2kor\\Desktop\\1 1 1 1.txt";
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + file);
    <CODE>

    Output:
    I get an 'Unable to open "C:\Documents and Settings\mit2kor\Desktop\1 1 1 1.txt"' error message, when the code snippet is run. Enclosing the variable 'file' within a double quote also does not work.

    Can anybody help?
    Thank you in advance....

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,435
    Rep Power
    25

    Default

    //cmd= rundll32 url.dll,FileProtocolHandler file://D:/www/index.html
    My notes show the above for a cmdline

Similar Threads

  1. open a pdf file in linux
    By aparna in forum Advanced Java
    Replies: 5
    Last Post: 06-08-2010, 12:51 PM
  2. how to open a file through URL
    By katie in forum New To Java
    Replies: 3
    Last Post: 07-13-2008, 02:53 AM
  3. Open File
    By JavaLerner in forum SWT / JFace
    Replies: 5
    Last Post: 07-12-2008, 06:41 PM
  4. To open an image file such as Jpeg file using JAva Program
    By itmani2020 in forum Advanced Java
    Replies: 10
    Last Post: 07-11-2008, 09:57 AM
  5. Is it possible to open a txt file?
    By jason27131 in forum New To Java
    Replies: 20
    Last Post: 08-07-2007, 01:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •