cd..
is wrong syntax and works just by chance.
The right syntax is: commandSPACEargument
The command is cd
and the argument is the relative path ..\
.
But cmd.exe
searches first for a file with name cd
on using cd..
because it interprets cd..
as mistyped file name and not as internal command CD. And Windows command processor tries to run found file when there is in current directory really a file with name cd
as it is obviously the case for directory c:\sebas\miscosas
.
The two dots at end of cd..
are removed by cmd.exe
on searching for a suitable directory entry. Removing trailing spaces/tabs and trailing dots is nearly always done as part of an error correction as it can be seen on running the command line:
echo Hello world!>"cd.. "
This command line creates a file with name cd
without the two dots and the two spaces at end.
See also DosTips forum topic ECHO. FAILS to give text or blank line - Instead use ECHO/ which is about the same issue.
And see also Microsoft article about Naming Files, Paths, and Namespaces.
The usage of cd..\
works even if there is a file with name cd
in current directory. But this command line is nevertheless using wrong syntax and works again only by chance. If there would be a file with name cd.
in current directory, this command line would fail again because of cmd.exe
searches now for a file with name cd.
in current directory.
So in future use command CD only with right syntax: cd ..\