I want to run a simple one-liner in the Windows CMD prompt to print my %PATH%
variable, one entry per line.
I tried this: for /f "delims=;" %a in ("%path%") do echo %a
but this only prints the first entry:
Z:>for /f "delims=;" %a in ("%path%") do echo %a
Z:>echo c:python25.
c:python25.
Also as you can see from the output above, this is also printing the echo %a
command as well as the output. Is there any way to stop this?
If I try a similar command, I get all the entries, but still get the echo %a
output spamming the results. I don't understand why the following prints all entries, but my attempt on %PATH%
doesn't. I suspect I don't understand the /F
switch.
Z:>for %a in (1 2 3) do echo %a
Z:>echo 1
1
Z:>echo 2
2
Z:>echo 3
3
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…