From f8ea2c755b02f57878f0cb99adb9d6ef617d56bc Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 17 Dec 2020 13:38:14 +0100 Subject: [PATCH] DocumentPropertyMenu: Select file when opening from context menu --- GUIs.Common/DocumentPropertyMenu/DocumentPropertyMenu.vb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/GUIs.Common/DocumentPropertyMenu/DocumentPropertyMenu.vb b/GUIs.Common/DocumentPropertyMenu/DocumentPropertyMenu.vb index 0ae360ca..36adb5aa 100644 --- a/GUIs.Common/DocumentPropertyMenu/DocumentPropertyMenu.vb +++ b/GUIs.Common/DocumentPropertyMenu/DocumentPropertyMenu.vb @@ -99,8 +99,13 @@ Public Class DocumentPropertyMenu Exit Sub End If - Dim oDirectory = IO.Path.GetDirectoryName(_FilePath) - Process.Start(oDirectory) + Dim oArgs As String = $"/e, /select, ""{_FilePath}""" + Dim oInfo As New ProcessStartInfo() With { + .Arguments = oArgs, + .FileName = "explorer" + } + + Process.Start(oInfo) End Sub Private Function TestPathExists(Title As String) As Boolean