Skip to content

Commit 47878f3

Browse files
committed
Fix file explorer invocation to ensure correct file selection behavior
1 parent 6333cd3 commit 47878f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,10 @@ public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null
338338
// Windows File Manager
339339
explorer.StartInfo = new ProcessStartInfo
340340
{
341-
FileName = targetPath,
341+
FileName = "explorer.exe",
342+
Arguments = FileNameOrFilePath is null
343+
? DirectoryPath // only open the directory
344+
: $"/select,\"{targetPath}\"", // open the directory and select the file
342345
UseShellExecute = true
343346
};
344347
}

0 commit comments

Comments
 (0)