Sadly the accepted answer is incomplete and requires manual steps.
The reason why your "Auto" button is greyed out is that you did not execute the second executable that is required for that: "Teensy_Reboot.exe".
You find it on your disk if you have installed TeensyDuino.
First kill Teensy.exe if it is running (Important)
Then you write path and file of your Hex file into the registry:
Then you start Teensy.exe
Then you start Teensy_Reboot.exe as a hidden process.
That is the solution of your problem!
It is a shame that Paul does not document his stuff.
NOTE: If you have previously loaded a sketch into the Teensy that was compiled with "USB Type: No USB" the reboot will not work and the button on the board must be pressed manually, but Teensy_Reboot.exe is still usefull because it enables the green "Auto" button in Teensy.exe.
NOTE: Teensy_Reboot.exe has a severe bug: If the Teensy.exe is not successfull because another program still had the Teensy CDC COM port open while you started Teensy.exe, the Teensy_Reboot.exe may run eternally consuming 100% CPU under some circumstances. I reported that bug in the forum of Paul but he never answered to my posting.
The disadvantage of using teensy_reboot.exe is that you don't know if the programming was successful or not because sadly teensy_reboot does not return any usefull exit code.
So the better option (which requires more code) is to instruct Teensy.exe directly from your program. Therefore you need a TCP connection to localhost.
You find more details in this thread:
where Paul (once again) did not answer my question.
You can even replace Teensy.exe with your own code.
Have a look at this project: https://github.com/Koromix/ty
Sadly this code depends on the huge QT library. Apart from that it may not work with future versions of Teensies.