How do I know that hex files generated belongs to my sketch or not?

I have generated .hex files from my sketch and these files are saved somewhere in my PC but not in the same folder where my actual sketch is present. So, how can I identify that these files belongs to my sketch or not?

Thank you in advance.

Do this:

  • Sketch > Export compiled Binary
  • Sketch > Show sketch folder

Then the .hex files are saved to the same folder as the sketch and so you will surely not get confused.

Hello Sir,
Thank you for your reply. But what if I don’t have the sketch and I have only hex files to load into the arduino. Because, someone can change the file and upload the wrong file into Arduino. Is there anyway to stop this?

To answer first question, the hex file is saved in a temporary build folder when you don't do export compiled binary. If you turn on verbose compilation, you can see where it's putting them, though this isn't very useful

It's unclear what youre asking in second post. Are you trying to make sure that only one specific sketch can be run on your arduino? Someone dedicated to uploading their own hex file to an arduino can always do so. Even if you disable programming with the fuses, someone can erase with hvsp and put on their own code.