Is there a way to set the global windows path environment variable programmatically (C++)? As far as I can see, putenv sets it only for the current application.
There is no API - changing the registry is the way to do it. The changed value will be used for processes starting after the change was made.
Also: Notice that running applications must actively process the settings changed message and many (most?) do not do so.