1

after restarting my machine The path variable has been reset. In what scenarios the path variable is reset?

0

2 Answers 2

2

It depends on how you set it.

If you run set PATH=... in Command Prompt, the environment variable is modified only for the cmd.exe process (and for all programs you run from the same Command Prompt window). Other processes are not affected.

To make your changes permanent, go to System Properties → Advanced → Environment Variables and under User variables click New.

0

A quick and easy way to permanently edit the PATH in windows from the command line:

C:\WINDOWS>setx PATH "PATH;C:\some_new_path"

This will update the PATH by appending the new path to the existing path value. Typing the following command will print the new PATH in all future CMD windows; NOT in the current CMD window:

C:\WINDOWS>PATH

Typing the following will give you a list of all the environment variables:

C:\WINDOWS>set

You must log in to answer this question.