Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print Windows %PATH% with every entry on new line

Tags:

windows

cmd

I have a task: print all entries of %PATH% variable on new line. For example:

C:\Program Files\
C:\Windows
C:\Windows\System32

and so on...

like image 444
Groosha Avatar asked Apr 08 '13 17:04

Groosha


People also ask

How do you echo paths?

If you type in a built-in command like ls, it will look for a specified list of directories. You can look up your path by typing echo $PATH. Here is one difference between Windows and *nix: By default, Windows always looks for the executable file in the current directory. For example, if you have a file called uptime.

How do I echo path variable in Windows?

Select Start > All Programs > Accessories > Command Prompt. In the command window that opens, enter echo %VARIABLE%. Replace VARIABLE with the name of the environment variable.


1 Answers

Solved: I used echo %path:;=&echo.%

Source (the original link is dead, now linking to WebArchive)

like image 83
Groosha Avatar answered Sep 26 '22 00:09

Groosha