Your code is essentially asking the operating system's runtime to handle the file. It uses the file extension to determine what it should do. For example, a .doc
extension would be opened with Word (ultimately the process handler would pass the file path as an argument to the target application: winword.exe {filepath}.doc
).
Windows doesn't know how to handle a .bin
file, so it turns to you for help - hence the program selector prompt.
You can only execute an executable, just change the file extension back to .exe
.
What confusion are you trying to prevent? For example, if you're trying to stop users from accidentally running the application, can't you move it to a different place where it might be a little harder to find?
If you really want to call it something else (and this is really, really messy), you could rename the file just before and after you run it. However, I would highly recommend you don't do this, it's really bad design!