Automate setting for NVIDIA control panel


I am looking for a way to automate “NVIDIA Control Panel” setting.
Need to change Preferred graphics processor setting to “High-performance NVIDIA processor” under Global Settings of Manage 3D settings.

Does anyone know how this could be done by script, command or registry?
OS: Windows 10/11

Thank you.

I don’t think so:
There once was an api using nvcpl.dll but that’s gone. The preferred gpu should be managed by windows, though, so this should be settable without the control panel. Seems it doesn’t work either:
This is the Linux forum, BTW. So Windows knowledge is near to zero.

Thank you for the reply.
I might need to find other way to solve this.

Yeah, I do know this is a Linux forum, but this is where Nvidia’s support person suggested me to post :)