0

the path command displays list of paths of executable files delimited by ; . I have tried to get help for command as follows

path --help

Later when I attempt to run commands like taskkill or ping, I got response as

'taskkil' is not recognized as an internal or external command, operable program or batch file.

Then I realized I have overwritten the path variable. now path variable value is "--help"

when I close and open another command prompt , now taskkill , ping commands are working. Also now path command displays same lists of paths that i have overwritten. How the path variable retains its values ?

1 Answers1

1

When you start up a program such as your terminal your operating system creates an environment for your program.

As part of that environment it copies the current system environment into the programs environment.

Within that program any change to the path or other environment variables will only modify the environment for that program.

If you want to change the environment variables for the system then you should use the system provided methods for doing so. You will have to restart any programs you are using in order for them to "see" the new environment.

What are PATH and other environment variables, and how can I set or use them?

Mokubai
  • 95,412