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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -