David
David

Reputation: 111

would Java's Runtime.getRuntime().exec() run on windows 7?

i have windows xp and developing some java swing application.
In my program i am using

Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL "+ myfile);

to open the file produced from my program in windows default editor.

It works fine on my system. I just want to know would it work OK on windows 7.
Are there any security aspects to this process execution in windows 7 which does not show up in windows XP?

Upvotes: 6

Views: 2769

Answers (1)

BalusC
BalusC

Reputation: 1108842

Not a direct answer, but you're supposed to use Desktop#open() for this to be platform independent.

Desktop.getDesktop().open(file);

Upvotes: 9

Related Questions