Possible to write a simple script using NVAPI?

I have a gaming PC that is ONLY connected to a 4K LG TV. There’s no proper monitor for it. And, it’s in the middle of the living space in the house with no attractive (or easy due to furniture placement) way to plug in a 2nd monitor–nor do I own a 2nd monitor with HDMI which is a whole separate issue. Suffice to say–plugging in another monitor is not a good long term solution.

The problem? there are many video modes/resolutions that simply don’t work with the TV. And, if a game calls up an incompatible resolution, the screen just goes blank with no way to revert. Rebooting the computer usually comes up in the last known state–which is the state that renders no picture. Just this morning the power went out for 20 minutes, and when rebooted it came up in an unsupported (default) mode.

My goal is to write a script that will set the proper resolution/mode and have it run at startup. I’m not sure how that will look at the moment. I’m not a programmer. I found some C+ source that might look promising–but, I don’t have an IDE set up, and I don’t really want to have to learn programming for such a seemingly simple task. I was hoping for something simple or already done that I could easily modify without having to recompile.

Anyone know of anything helpful?