cd "C:\path\to\directory\" >nul & echo %CD%
Say I run that in C:\dir
. I'd expect it to output C:\path\to\directory
since that's what it does if I run each command individually and in succession. But it doesn't do that. When the two commands are sorta concatenated together it outputs the current path - eg. C:\dir
.
Any ideas why? Alternatively, any ideas as to how I can get the full path from a relative path via the CLI?