Случайно удалил PATH в Windows 8

603
Cazs

Поэтому на прошлой неделе я пытался установить Ant и случайно удалил переменную среды Path. Я действительно не знаю, что я делаю. Какой эффект это окажет / что я могу сделать, чтобы это исправить?

0

2 ответа на вопрос

0
James Taylor

It’s hard to say what effect this would have. I wouldn’t think your computer would have an immediate problem.

The PATH keeps track of variable associations to locations in the file system. For example, a variable like APPDATA would be defined to point to C:\Users\User\AppData\Roaming.

That said, you need to restore it.

You can try to get it back by running the following command, according to this source that also does a good job of explaining what the environmental variable PATH is:

echo %PATH% 

or doing System Restore.

Ссылка на источник ничего не говорит о `echo% PATH%`, хотя его восстановление. Ramhound 9 лет назад 0
Попробуйте прокрутить 3/4 вниз по странице. `echo` по сути означает, что компьютер будет повторять` PATH`. Этот метод, вероятно, не сработает, если старый `PATH` больше не будет в памяти. Это, однако, все объясняется в связанном источнике. James Taylor 9 лет назад 0
0
user4294507

I wouldn't worry too much about it, as fresh Windows installs come with an empty path anyway.

Windows uses PATH to configure paths to directories that contain programs. It is used to make life easier and not have to type full paths to all exe files.

For example, if you download Tiny C Compiler, and unzip it in C:\, you would expect the path to to tcc.ece to be "C:\TCC\bin\tcc.exe".

If you open cmd up, and type tcc.exe, an error would return stating that path cannot be found. This is because Windows scans all its known paths for a match in the command you provided. By default, system32 folder is checked first, and PATH values afterwards.

If you add 'C:\TCC\bin' to PATH, windows will search in bin folder for matching names of commands you give. After applying thr new settings and re-opening the cmd prompt, you can enter 'tcc -h', and the conpiler will display an its help message to you.

In essence, it provides "windows-level" shortcuts to program locations. This can affect you if software you used relied on PATH. For example, if you had nmap installed, it will no longer be accessable via 'nmap' command via cmd.

Watch out for new error messages, which point to errors in paths, and steadily rebuild them.

Format of PATH is: C:\nmap\bin;C:\TCC\bin;C:Tools

Have fun