runtime.exec - how to open a file using exec method in java? -


c:\users\admin\downloads\vid_20160226_203631957.mp4 

when execute above line in command prompt corresponding video gets played default media player.

but when try same using java runtime class doesnt work. using following method.

runtime r= runtime.getruntime(); r.exec("c:\users\admin\downloads\vid_20160226_203631957.mp4") 

try this.

runtime r= runtime.getruntime(); r.exec("cmd /c c:\\users\\admin\\downloads\\vid_20160226_203631957.mp4"); 

Comments

Popular posts from this blog

javascript - Hide toolbar of pdf file opened inside iframe using firefox -

Ansible - ERROR! the field 'hosts' is required but was not set -

Copy range with conditional formatting -