Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the name of the current executable in C#?

I want to get the name of the currently running program, that is the executable name of the program. In C/C++ you get it from args[0].

like image 280
Joakim Avatar asked Mar 05 '09 21:03

Joakim


People also ask

What is the name of the executable?

.exe is a common filename extension denoting an executable file (the main execution point of a computer program) for Microsoft Windows.

What is the executable in C?

Executable (also called the Binary) is the output of a linker after it processes the object code. A machine code file can be immediately executable (i.e., runnable as a program), or it might require linking with other object code files (e.g. libraries) to produce a complete executable program.

Where is executable located?

Right-click the “Start” menu shortcut for the application, and select More > Open file location. This will open a File Explorer window that points to the actual application shortcut file. Right click on that shortcut, and select “Properties.” No matter how you located the shortcut, a properties window will appear.


1 Answers

System.AppDomain.CurrentDomain.FriendlyName 
like image 133
Steven A. Lowe Avatar answered Oct 02 '22 13:10

Steven A. Lowe