user3078482
user3078482

Reputation: 1

Using processbuilder

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.

Upvotes: 0

Views: 327

Answers (2)

4J41
4J41

Reputation: 5095

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

Upvotes: 1

Elliott Frisch
Elliott Frisch

Reputation: 201409

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

Upvotes: 0

Related Questions