Get program's file name

In Visual Basic 2005, is it possible to get the file name of my program? I found I can get the directory the program is in through My.Application.Info.DirectoryPath. However, that does not return the name of the program, just where the program is. Basically, my program installs itself, but if the program does not know its own filename, how can it copy itself to the installation directory?

Thanks.

[412 byte] By [pu132] at [2007-12-24]
# 1

My.Application.Info.AssemblyName

See post http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=327593&SiteID=1

TallDude at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 2
Never mind. I found My.Application.Info.AssemblyName. I just have to add the .exe to the end.
pu132 at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 3
It turns out that AssemblyName only refers to the name the program was assembled under. After I renamed the program, AssemblyName did not change. Is it possible to get the name of the program's process instead? Because the process name changed when I renamed the program.

Thanks.

pu132 at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 4

or just:

Dim theAppName as String = Path.GetFileName(Application.ExecutablePath)

ahmedilyas at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 5
Thanks, that's exactly what I need.
pu132 at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 6
glad we could help :-)
ahmedilyas at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...