Good morning,
I have a JWS component to open some shared folder from a Java Web app.
The only code that runs the JWS is this:
Runtime.getRuntime().exec("explorer.exe /root,\"" + path + "\"");
It usually works like a charm, but, when the path contains a folder with two consecutive blank spaces, the "My Documents" folder is opened instead. That's how it works explorer.exe for non existent folders, it opens the "My Documents" folder. But in this case, the folder exists!
For example:
String path = "C:\\Prueba doble espacio\\";
Runtime.getRuntime().exec("explorer.exe /root,\"" + path + "\"");
If I run this code, the "My Documents" folder opens in the explorer.
But if I open the CMD and runs this:
C:\>explorer.exe /root,"C:\Prueba doble espacio\"
The proper C:\Prueba doble espacio\ is opened in the explorer instead.
Any ideas on how to solve this?
Thank you very much!