CMD: File tasks, open directory and select file

Thom picture Thom · Apr 30, 2015 · Viewed 8.2k times · Source

I want to open a folder and automatically select a file from the command line:

>> explorer C:\Windows\system32\selected_file.txt

Once Windows Explorer has opened C:\Windows\system32 I want selected_file.txt to be highlighted automatically. Is that possible with Windows Command Prompt?

Answer

Tony Hinkle picture Tony Hinkle · Apr 30, 2015
explorer.exe /select,c:\windows\system32\selected_file.txt

See https://support.microsoft.com/en-us/kb/130510