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

c++ - list<myClass<int> * > sort -

c - Defining floating point constants, how many digits are useful? -

C# Apple Bonjour - how to monitor service records within Windows -