How to use java code to open Windows file explorer and highlight the specified file? April 26, 2023 by Tarik Use: Runtime.getRuntime().exec("explorer.exe /select," + path); This also works if there is a space in the PATH.