Java reads and writes the value of the windows environment variable

ask me, now I want to do an action, that is, read the value of the windows system environment variable, such as the value of PATH, and then modify the value of PATH, save, how to do it? Limited to the java language, how can it be implemented? If not, how can other python or cPP be implemented? Ps: priority java

Mar.02,2021

remind you that the environment variables of windows are stored in the registry, and permanent modification requires editing the registry, so you need to have the corresponding permission to edit the corresponding registry key values.

Menu