Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
File path from disk i.e. d:\study\myfile.pdf...... should be given as input to the program. It should invoke acrobat reader and load myfile.pdf automatically.
It should run for all types of file formats. If there is no associated system program available then it should open dialog box that we see as "open with" option.
Posted
Comments
Richard MacCutchan 4-Apr-12 8:58am    
Or you could just use Windows Explorer.

1 solution

is this homework? I'll give this:

Java
// find program for file type
final Program p = Program.findProgram("pdf");
// throw file at OS and let it execute the file
p.execute(printFilePath);


The "open with" dialog appears automatically when the OS does not know what to do with the file.

For more you'll need to post your own code that you have made up so far.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 5-Apr-12 2:22am    
My 5 for so serious appearance. ;-)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900