0

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.

2
  • Don't have a PC at hand, but try listing the files using a single /select parameter, for example "/select,file1,file2" Commented Dec 7, 2013 at 20:56
  • Already tried and only file one will be highligthed. Commented Dec 7, 2013 at 20:59

2 Answers 2

1

I doubt if explorer.exe provides options to select multiple files.

Sign up to request clarification or add additional context in comments.

1 Comment

Do you know anything else i could you instead?
0

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");

1 Comment

Thanks but it didnt work. Only file1 is highligthed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.