Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing file in Windows Explorer

My favorite IDE Wing IDE has a command for showing the active file in Explorer. This means that when you launch the command, it opens an explorer window on the folder that the file is in, and then selects the file.

The problem is, that if the window is already open, it fails to select the file. It activates the window, but the file doesn't get selected. That's annoying. I want the file to always be selected

I spoke to one of the developers and he said that they're using 'explorer /select,%s' % filename to show the file, and that the above annoyance might be a quirk of that command.

Does anyone have an idea how to avoid this behavior?

(The solution needs to work in Windows 2000, XP, 2003 Server, Vista, and Windows 7.)

like image 810
Ram Rachum Avatar asked Dec 04 '12 11:12

Ram Rachum


1 Answers

As per https://support.microsoft.com/en-us/kb/152457, which states "switches can be combined", what about:

explorer /n,/select,c:\path\to\file.ext

/n should force a new window.

like image 113
El Zorko Avatar answered Oct 19 '22 22:10

El Zorko