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
Post a Comment