ECHO %path:;=&ECHO(%
:) :)
Edit for expansion.
The syntax %var:string1=string2%
replaces all string1
with string2
within var
hence this command is resolved to
echo directory1&echo(directory2&echo(directory3...
at each ;
which is the separator used between directorynames in %path%
.
The echo(
is a trick construct. There are many characters which are ignored to one extent or another DIRECTLY following echo
. SPACE
is the most common, but the command ECHO
will show the ECHO
state - ECHO is on/off
. ECHO(
however will show nothing (other than any characters following the (
).
As it happens, my path
ends with ;
so if I was to use &echo
to replace ;
then the line would be resolved to ....echo dirlast&echo
and produce the ECHO
state as a last line. Using echo(
neatly overcomes this problem.