Reveal file on Windows

Ken Ray kray at
Wed Sep 22 18:43:15 EDT 2004

On 9/22/04 3:05 PM, "Trevor DeVore" <lists at> wrote:

> I was looking through the archives to find out how to reveal a file on
> Windows and have it selected in Win Explorere but didn't find anything
> on it.  After querying my good friend Google about it I came across
> this.  To reveal a file on Windows you can use pass commands to
> explorer.exe.
> explorer.exe /select, "c:\Path to my file\myFile.txt"
> This would open windows explorer with the file myFile.txt selected.
> I've tested this on Win XP so far and it works great.  I can test on
> some other platforms later on to see if this breaks and my joy was for
> naught but if anyone wants to play around with it here are two
> functions for cross-platform opening a folder and revealing a file.

You can keep your joy - this works all the way back to Windows 95 (I tested
it). The only thing that might stifle a bit of your joy is that if you are
trying to reveal a file that is in a protected folder (or in the case of a
basic Windows 98 install, anything in the Windows directory), it will open
the folder that owns the file you're trying to reveal and stop dead in its

I tested:

  explorer.exe /select,"c:\windows\notepad.exe"

going back to Windows 95 and it worked fine except for Windows 98 that
opened the Windows folder and showed the goofy "To view the contents of this
folder, click Show Files" warning...

Cool tip, Trevor!

Ken Ray
Sons of Thunder Software
Web site:
Email: kray at

More information about the use-livecode mailing list