I'm trying to use ProcessBuilder in order to highlight several files contained in a folder. When I run the following code:
List<String> params = java.util.Arrays.asList("explorer.exe", "/select,C:\\test\\file1.txt",
"/select,C:\\test\\file2.txt");
ProcessBuilder b = new ProcessBuilder(params);
only the second file is highlighted. Any idea on how to fix it?
Thank you in advance.
-
Don't have a PC at hand, but try listing the files using a single /select parameter, for example "/select,file1,file2"MadProgrammer– MadProgrammer2013年12月07日 20:56:25 +00:00Commented Dec 7, 2013 at 20:56
-
Already tried and only file one will be highligthed.user3078482– user30784822013年12月07日 20:59:32 +00:00Commented Dec 7, 2013 at 20:59
2 Answers 2
I doubt if explorer.exe provides options to select multiple files.
answered Dec 7, 2013 at 21:00
4J41
5,0951 gold badge31 silver badges43 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
user3078482
Do you know anything else i could you instead?
Instead of
java.util.Arrays.asList("explorer.exe", "/select,C:\\test\\file1.txt",
"/select,C:\\test\\file2.txt"
try (from the relevant knowledge base)
java.util.Arrays.asList("explorer.exe", "/select,C:\\test\\file1.txt,select,C:\\test\\file2.txt");
answered Dec 7, 2013 at 20:59
Elliott Frisch
202k20 gold badges166 silver badges265 bronze badges
1 Comment
user3078482
Thanks but it didnt work. Only file1 is highligthed.
lang-java