Echo %path% on separate lines?

后端 未结 3 1277
一生所求
一生所求 2020-12-12 14:36

Using the windows command prompt, can I echo %path% and get the resulting paths on separate rows? Something like this but for windows:

echo $path | tr \':\'         


        
相关标签:
3条回答
  • 2020-12-12 15:10

    Try:

     ($env:Path).Replace(';',"`n")
    

    or

    $env:path.split(";")
    
    0 讨论(0)
  • 2020-12-12 15:34

    Fewer keystrokes using either the split operator or method

    $env:Path -split ';'
    $env:Path.split(';')
    
    0 讨论(0)
  • 2020-12-12 15:35

    this works for me (in a cmd window):

    powershell -Command ($env:Path).split(';')
    
    0 讨论(0)
提交回复
热议问题