Miracle, it works!
Don’t ask me why, but when I, after quite a long study of nerve damage on the Internet, was close to giving up and using a temporary batch file as a workaround, I forgot to add / select, a parameter to the command, and who could think in my win 7 32bit system the following works.
String param = "\"C:\\Users\\ME\\AppData\\Local\\Microsoft\\Windows\\Temporary Internet Files\\\""; try { String[]commands = new String[]{"explorer.exe", param}; Process child = Runtime.getRuntime().exec(commands); } catch (IOException e1) { System.out.println("..."); }
Common decision:
The bug database solution mentioned in his post ( http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511002 ) did a great job with me.
Cause:
Apparently, the problem is commenting out some of the characters executed by java that it executes before actually executing the command line. You have to do the commenting yourself, giving the token command line to prevent java-1 from being corrupted before spring and ruin everything.
How to fix:
So, in my case, I had to do the following (tokenize my command line so that there are no spaces in the line):
String param[] = { "explorer.exe", "/select,C:\\Users\\ME\\AppData\\Local\\Microsoft\\Windows\\Temporary", "Internet", "Files\\"}; try { Process child = Runtime.getRuntime().exec(param); } catch (IOException e1) { System.out.println("..."); }
As you can see, I basically started a new line, wherever the space takes place, so the “Temporary Internet files” have become “temporary”, “Internet”, “files”.
source share