0

Is it possible that the following code is no longer working when the application is running on windows 8

Runtime.getRuntime().exec("path\\to\\dotexe");

On Windows 7 it used to do the job just fine, but on Windows 8 it just wont run the d*rn .exe.

Is there any alternative to this code, or does the not running has to do with user rights on Win8 or something?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Jeroen Pleysier
  • 151
  • 1
  • 8
  • Read (and implement) *all* the recommendations of [When Runtime.exec() won't](http://www.javaworld.com/jw-12-2000/jw-1229-traps.html). That might solve the problem. If not, it should provide more information as to the reason it failed. Then ignore that it refers to `exec` and build the `Process` using a `ProcessBuilder`. Also break a `String arg` into `String[] args` to account for arguments which themselves contain spaces. *"Kind regards & thanks in advance, Jeroen."* Leave such noise out of questions in future. – Andrew Thompson Jun 12 '13 at 17:31
  • Andrew, it appears that it did not work because of spaces in the folder path (which is strange, under Windows 7 it just worked fine). Thanks for the support, I will be able to fix it from here on with String[] args like you said. And the regards were just because I was raised to be polite ;) – Jeroen Pleysier Jun 12 '13 at 17:57
  • Glad you got it sorted. :) – Andrew Thompson Jun 13 '13 at 00:26

0 Answers0