See this superuser question. I need to run the command
explorer.exe /select,"C:\Program Files\foobar"
from Java. The following Java code does NOT work like the above command line call (the Explorer selects a completely different directory):
Runtime.getRuntime().exec(new String[] {
"explorer.exe",
"/select,\"C:\\Program Files\\foobar\""
});
What other options I have from pure Java side (no native code)?
You could place the
/selectin a separateStringtoken to stop it being treated as part of the path: