Quando eu uso cd /c:
, ele não está mudando para a unidade C.
Observe que o comando acima está incorreto, deve ser cd c:\
ou c:/
.
Se você quiser alterar a unidade atual além de alterar o diretório, use a opção /d
:
cd /d c:\
Use the /D switch to change current drive in addition to changing current directory for a drive.
Exemplo:
F:\test>cd c:\
F:\test>rem drive doesn't change
F:\test>cd /d c:\
c:\>rem drive changes
cd
usage
c:\>cd /?
Displays the name of or changes the current directory.
CHDIR [/D] [drive:][path]
CHDIR [..]
CD [/D] [drive:][path]
CD [..]
.. Specifies that you want to change to the parent directory.
Type CD drive: to display the current directory in the specified drive.
Type CD without parameters to display the current drive and directory.
Use the /D switch to change current drive in addition to changing current
directory for a drive.
If Command Extensions are enabled CHDIR changes as follows:
The current directory string is converted to use the same case as
the on disk names. So CD C:\TEMP would actually set the current
directory to C:\Temp if that is the case on disk.
CHDIR command does not treat spaces as delimiters, so it is possible to
CD into a subdirectory name that contains a space without surrounding
the name with quotes. For example:
cd \winnt\profiles\username\programs\start menu
is the same as:
cd "\winnt\profiles\username\programs\start menu"
which is what you would have to type if extensions were disabled.
Leitura Adicional
- Um índice A-Z da linha de comando do Windows CMD - Uma excelente referência para todas as coisas relacionadas à linha do Windows cmd.
- cd - Alterar diretório - Selecionar uma pasta (e unidade)