I write a program which is run under the terminal on windows, it needs to specify the PATH so that it could be called without full absolute path. However, I have specified the "PATH" and save the value to the "users'" environment variables. However, this doesn't take effect unless I reboot the terminal. If I manually set the PATH like this:
PATH=%PATH%;D:\folder
The terminal could find the executable program under the D:\folder, if I call the set in an external program, it seems it doesn't affect current terminal.(Maybe the external program is the child progress of current terminal which the PATH only exists for current session). I already tried "set PATH=xxx" and "PATH=xxx", none works. So the problem is how can I reset current terminal session's envionment by an external program? I don't want to manually set the PATH in the terminal, this would be tedious for the user. Is there a way to do so? BTW, I noticed this Setting Windows PowerShell path variable, after I called "setx PATH D:\folder -m", it shows that the operation was success, but I output the $PATH and the value doesn't include D:\folder