Is there a way to set the environment path programmatically in C++ on Windows?

后端 未结 5 1247
野的像风
野的像风 2020-12-08 16:24

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.

5条回答
  •  一整个雨季
    2020-12-08 16:44

    If you want to do it through the registry, you might want to look at the source code of this program.

    Microsoft also provides a small command line utility called setx with its resource toolkits, which will let you do this. By the way, the regular set command just lets you define local environment variables I think.

提交回复
热议问题