.exe name from within the application?

Trekkan

New member
Joined
Dec 26, 2005
Messages
1
Programming Experience
10+
I've searched and can't find the answer to this question (maybe my search terms aren't good)... I know there was an easy way to do this in VB6, something like application.name.

Basically I need to know what the executable name is currently running. For instance I want to return an error message and use the name of the .EXE file in it for passing parameters, so it looks right to the end user.

The .EXE will probably be renamed, etc... so I'm just trying to keep my error messages consistant and accurate.
 
VB.NET:
Dim strExeName As String = Application.ExecutablePath
strExeName = strExeName.Replace(Application.StartupPath & System.IO.Path.DirectorySeparatorChar, "")
MessageBox.Show(strExeName)

and welcome to the forums
 
Back
Top