In this program that I'm making, it renames itself to a random string of like 8 characters every time it runs. Previusly I've been using a registry key to keep the new name that it was named to in order to know what file to rename to change it next time.

What I wanted to know is if there is a sort of "Self Reference" Command for renaming or just getting the name of the file. Now I'm not talking about Me. with forms and stuff, this is about the .exe name. I've looked and looked and haven't come up with anything, does anyone know a command/function to get the name of the program while it's running itself?