Thursday, March 22, 2007

Invoke any files in its native application from java code

Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + file.getAbsolutePath());

Windows will try to start the appropriate program (whatever application is registered for the files). This works for all types of files, no matter what file format is.

No comments: