Open a folder under Program Files in Windows Explorer using C#

48 views Asked by At

I have a log file for my program, which I leave in the install directory. The default install directory is Program Files (x86 on 64bit systems). I would like to be able to include a menu option called "Get Log File" in my program where the directory of the log file is opened up with the file selected if the user clicks the menu. The idea being it makes it easier to get to the file if I need them to email it to me for any reason.

The problem is that Process.Start("explorer.exe") will not open a directory under the Program Files directory, nor will it open a file that is there.

Anyone have any idea of how to accomplish this? Is there a better way to handle this instead of trying to open a folder to it (maybe just copy it to their desktop or something) that some one has implemented before?

0

There are 0 answers