CMD: File tasks, open directory and select file
Asked Answered
U

1

10

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?

Ultravirus answered 30/4, 2015 at 14:49 Comment(0)
M
13
explorer.exe /select,c:\windows\system32\selected_file.txt

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

Mallarme answered 30/4, 2015 at 15:5 Comment(3)
Is there a way to select the file without opening a new window? Let's say the folder is open and I want to select a file in the open folder. How would I do that using cmd?Ophir
@akinuri: did you ever find out how to do what you have asked? What about the same for multiple files at once?Cretin
@Cretin Nope. I created a custom "New" submenu in the context menu, and wanted to be able to rename the file after its creation, you know, like the way Windows does. Kinda gave up on this "select" thing. I just do it manually.Ophir

© 2022 - 2024 — McMap. All rights reserved.