Skip to content

Commit 2837b65

Browse files
committed
fixes #19
1 parent b7c833a commit 2837b65

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/org/cryptomator/windows/revealpath/ExplorerRevealPathService.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ public class ExplorerRevealPathService implements RevealPathService {
2020
public void reveal(Path p) throws RevealFailedException {
2121
try {
2222
var attrs = Files.readAttributes(p, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
23-
var args = (attrs.isDirectory() ? "" : "/select,") + "\"" + p.toString() + "\"";
24-
ProcessBuilder pb = new ProcessBuilder().command("explorer", args);
23+
ProcessBuilder pb = new ProcessBuilder();
24+
if(attrs.isDirectory()) {
25+
pb.command("explorer.exe",p.toString());
26+
} else {
27+
pb.command("explorer.exe ","/select,",p.toString());
28+
}
29+
2530
var process = pb.start();
2631
if (process.waitFor(5000, TimeUnit.MILLISECONDS)) {
2732
int exitValue = process.exitValue();

0 commit comments

Comments
 (0)