Solve the problem that the ping command cannot be used - the priority of the environment variable

origin

        Due to the need to reproduce various vulnerabilities, the version of Python required to build different environments is also different, so I fiddled with the environment variables. I didn’t know that the original system configuration was forgotten after the reproduction was over. After using ping, I opened Pycharm inexplicably. The ping.py file is automatically opened 

Solution

1. Find the directory where ping.exe is located in the system, and add the directory to the environment variable Path (if there is no ping.exe, you can download and upload it from the Internet, pay attention to comparing md5)

 2. It shows that the ping.exe path exists, but the priority is overwritten by the previous variables. When ping is entered, it is processed directly according to the py file (maybe the same is the case when entering other commands), and my The default program to open the py file in the computer is Pycharm, so this happens

Move up to the top to use normally

Of course, if it is still unsuccessful, you can take a look at the user environment variable (here is the system environment variable) is also the case

Summarize

Don’t forget to restore the environment after the reproduction is over, such as virtual machine snapshots, so as to avoid confusion when there is a problem with the environment next time...

Guess you like

Origin blog.csdn.net/weixin_53009585/article/details/129974569