Joey Joey - 1 year ago 64 Question

How do I get the filename of my launched file without extension / directory?

How do I find the current name of my launched project without listing the directory or extension?

I've searched for other solutions, but all of them either has the extension at the end, and/or the directory location at the start, I just want the plain file name, no extension, no directory.


Dim Filename as string = (code that finds the file name)

Which would output
as for this example the program was named

Answer Source

If this is a WinForms app:

Dim fileName = IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download