> Use this.
> doskey cd=cd/d $* $T for /d ^%A in (.) do @title ^%~nxA
> Apparently, DOSKEY's `$T` special code caused the macro to somehow
> emit an extra ENTER key (WTH).
> Replace it with `^&` instead, just like in your original code. i.e.
Alas, both fail with an "~nxA was unexpected at this time."
When running that the above from within a batchfile this gets displayed :
"c:\>doskey cd=cd/d $* & for /d ~nxA"
IOW, the command partially disappears. :-|
But ... you gave me a push to try to mix-and-match stuff. :-)
It turns out that my "^$^$" can be replaced by "^$".
Your "^%A" / "^%~nxA" doesn't quite work here, so I put "%%A" / "%%~nxA"
I'm not sure what the "/d" for the "for" command does here. The code works
with and without.
And the source of my problem ? My usage of "%%CD%%" - replacing it with
your "." works.
The odd thing is that I'm sure I tried that too. But looking back I tried
several ones in a test batchfile, with the old tries "neutralized" by
preceeding them with a "rem" statement. Only now I realize that the "rem"
only worked for the first part, with the part after the "^$^$" still being
executed - and throwing an error. Which threw me off.
What I ended up with and seems to work is this :
doskey cd=cd /d $* ^& for %%A in (.) do @title %%~nxA
Thanks for your help.