Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How shall i find the exe path programatically..

For example i have an installed application exe inside my program files
the file path will be different based on the 64bi or 32bit


like c:\Program Files or c:\Program file(x86)

How shall i find the path of a file by just giving the filename??
Posted

 
Share this answer
 
Take a look at this answer.
get startup adr of application[^]

It might not be so obvious as using StartUpPath, as you might get unexpected results from it.
 
Share this answer
 
C#
public static string StartupPath { get; }


Gets the path for the executable file that started the application.

Sample:
C#
private void PrintStartupPath() 
{
    textBox1.Text = Application.StartupPath;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900