You could create a dedicated workbook, put the code in that workbook.
But rename them:
Option Explicit
Sub Auto_Open()
Application.OnKey "{f12}", ""
End Sub
Sub Auto_Close()
Application.OnKey "{f12}"
End Sub
Auto_Open will run when the workbook opens. Auto_Close will run when the
workbook closes.
Then save that new workbook with the macro in your XLStart folder (use windows
search to locate that folder).
Lots of people have their own customized workbooks with lots of macros like
this. They'll usually name this file personal.xls.
But if you're going to share it with others, you could name it
AnthonyUtils.xls
Then you don't have to worry about stepping on their files if they want both
open at the same time.