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

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

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -