runtime - Java code to run applications -


i need java code allow me run notepad , open specified file, example :

string []a={"c:/users/day/desktop/a.txt"}; process p = runtime.getruntime().exec("notepad",a); 

this code runs notepad not open file a.txt.
can problem ?

the second argument in exec represents environmental variables. want

string[] = { "notepad", "c:/users/day/desktop/a.txt" }; process p = runtime.getruntime().exec(a); 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -