Переход в корневой каталог в командной строке windows

Как перемещаться по каталогам посредством командной строки. В этой статье рассказывается, как перейти в другую папку (каталог) в командной строке Windows. Чтобы работать с командной строкой, необходимо использовать учетную запись...


Загрузить PDF


Загрузить PDF

В этой статье рассказывается, как перейти в другую папку (каталог) в командной строке Windows. Чтобы работать с командной строкой, необходимо использовать учетную запись администратора.

  1. Изображение с названием Change Directories in Command Prompt Step 1

    1

    Откройте меню «Пуск». Для этого щелкните по логотипу Windows в нижнем левом углу экрана или нажмите клавишу Win на клавиатуре.

    • В Windows 8 переместите указатель мыши в верхний правый угол экрана и щелкните по отобразившемуся значку в виде лупы.
  2. Изображение с названием Change Directories in Command Prompt Step 2

    2

    В строке поиска введите командная строка. Значок утилиты командной строки отобразится над строкой поиска.

  3. Изображение с названием Change Directories in Command Prompt Step 3

    3

    Щелкните правой кнопкой мыши по значку командной строки. Он имеет вид черного квадрата. Откроется контекстное меню.

  4. Изображение с названием Change Directories in Command Prompt Step 4

    4

    Нажмте Запуск от имени администратора. Эта опции находится в верхней части раскрывшегося меню. Откроется командная строка с правами администратора.

    • В открывшемся окне с предложением подтвердить ваши действия нажмите «Да».
    • Нельзя запустить командную строку от имени администратора, если вы работаете на компьютере, у которого есть ограничения, который находится в публичном месте или подключен к локальной сети (например, в библиотеке или в школе), то есть в том случае, когда вы пользуетесь гостевой учетной записью.

    Реклама

  1. Изображение с названием Change Directories in Command Prompt Step 5

    1

    Введите cd . После «cd» обязательно добавьте пробел. Эта команда, которая представляет собой сокращение от «change directory» (изменить каталог), является основной командой для перехода в другой каталог.

    • Не нажимайте клавишу Enter.
  2. Изображение с названием Change Directories in Command Prompt Step 6

    2

    Определите путь к нужному каталогу. Путь к каталогу похож на перечень папок. Например, если нужным каталогом является папка «System32», которая находится в папке «WINDOWS» на системном диске, путь будет таким: «C:WINDOWSSystem32».

    • Чтобы выяснить путь к папке, откройте окно «Мой компьютер», дважды щелкните по значку жесткого диска, перейдите в нужную папку, а затем скопируйте информацию из адресной строки Проводника (сверху).
  3. Изображение с названием Change Directories in Command Prompt Step 7

    3

    Введите путь к каталогу. Сделайте это после команды «cd». Убедитесь, что между «cd» и путем к каталогу есть пробел.

    • Например, команда может выглядеть так: cd WindowsSystem32 или cd D:.
    • По умолчанию местоположением всех папок считается жесткий диск (например, «C:»), поэтому букву жесткого диска вводить не нужно.
  4. Изображение с названием Change Directories in Command Prompt Step 8

    4

    Нажмите Enter. Так вы перейдете в нужный каталог.

    Реклама

Советы

  • Изменить каталог необходимо, чтобы отредактировать или удалить файл.
  • Некоторыми общими командами для работы с каталогами являются следующие:
    • D: или F: – изменить каталог на дисковод или подключенный флеш-накопитель.
    • .. – переместиться из текущего каталога на одну папку вверх (например, из «C:WindowsSystem32» в «C:Windows»).
    • /d – одновременно изменить диск и каталог. Например, если в командной строке вы находитесь в корневом каталоге диска «D:», введите «cd /d C:Windows», чтобы перейти в папку «Windows» на диске «C:».
    • – перейти в корневой каталог (например, системного диска).

Реклама

Предупреждения

  • Попытка запустить команду, связанную с определенным файлом или папкой, из другого каталога приведет к ошибке.

Реклама

Об этой статье

Эту страницу просматривали 664 613 раз.

Была ли эта статья полезной?

Вывод имени текущего каталога или переход в другую папку. При использовании только с именем диска (например chdir C:) команда chdir выводит имена текущих диска и папки. Выполненная без параметров команда chdir выводит текущие диск и каталог.

Синтаксис

chdir [[/d] [диск:][путь] [..]]  [[/ d] [диск:][путь] [..]]

cd [[/d] [диск:][путь] [..]]  [[/ d] [диск:][путь] [..]]

Параметры

/d
Смена текущего диска или текущего каталога на диске.
[диск:][путь]
Задание имени диска (если он отличается от текущего) и каталога, в который требуется перейти.
[..]
Переход в родительскую папку.
/?
Отображение справки в командной строке.

Заметки

  • Работа с расширениями командного процессора

    Если расширения командного процессора разрешены (задано по умолчанию), имена папок в пути к текущему каталогу отображаются точно так же, как на жестком диске, в том же формате имен папок с учетом регистра. Например, если имя папки на жестком диске C:Temp, команда CD C:TEMP задает текущий каталог C:Temp, соответствующий формату имени этой папки на жестком диске.

    Чтобы запретить расширения командного процессора для определенного процесса, введите следующую команду:

    cmd e:off

    Если расширения командного процессора запрещены, в команде chdir нельзя использовать пробелы в качестве разделителей. Таким образом, можно перейти в подкаталог, имя которого содержит пробел, не заключая параметр [путь] в кавычки. Например, следующий путь позволяет перейти в подкаталог Start menu.

    cd winntprofilesusernameprogramsstart menu

    Для получения дополнительных сведений о разрешении и запрещении расширений командного процессора щелкните ссылку CMD.

  • Переход в корневой каталог

    Корневой каталог является вершиной дерева каталогов на диске. Чтобы перейти в корневой каталог, введите следующую команду:

    cd

  • Переход из основного каталога одного диска в основной каталог другого

    Чтобы перейти в основной каталог диска отличного от текущего, введите следующую команду:

    chdir [диск:[каталог]]

    cd [диск:[каталог]]

    Чтобы проверить переход к этому каталогу, введите одну из следующих команд:

    chdir [диск:]

    cd [диск:]

  • Команда chdir с другими параметрами доступна в консоли восстановления.

Примеры

Используемая с именем диска команда chdir позволяет перейти в текущий каталог этого диска. Например, если ввести команду cd c: в приглашении каталога C:Temp, отобразится следующая строка:

C:Temp

Чтобы перейти в текущий каталог Reports, введите одну из следующих команд:

chdir reports

cd reports

Чтобы перейти из текущего каталога в подкаталог SpecialsSponsors, введите следующую команду:

cd specialssponsors

Или, если текущим каталогом является Specials, введите следующую команду, чтобы перейти в подкаталог SpecialsSponsors:

cd sponsors

Чтобы перейти из подкаталога в родительский каталог, введите следующую команду:

cd ..

Для вывода на экран имени текущего каталога можно использовать команду chdirили cd без параметров. Например, если текущим каталогом является PublicJones на диске B, вызов команды chdir приведет к следующему результату:

B:PublicJones

Если при работе на диске D требуется скопировать все файлы каталогов PublicJones и PublicLewis на диске C в корневой каталог диска D, введите следующую последовательность команд:

chdir c:publicjones

copy c:*.* d:

chdir c:publiclewis

copy c:*.* d:

Если требуется скопировать все файлы каталогов PublicJones и PublicLewis в текущий каталог диска D, введите следующие команды:

chdir c:publicjones

copy c:*.* d:

chdir c:publiclewis

copy c:*.* d:


Download Article


Download Article

This wikiHow teaches you how to change the folder (also known as the «directory») in which your Windows computer’s Command Prompt program operates. To make changes in Command Prompt, you must be using an administrator account.

Things You Should Know

  • Open start and type cmd. Right click Command Prompt and click Run as administrator.
  • Type cd and enter your directory’s path. The path can be found by looking at the address at the top of the folder you are directing to.
  • Press Enter.
  1. Image titled Change Directories in Command Prompt Step 1

    1

    Open Start. Either click the Windows logo in the bottom-left corner of the screen, or press the Win key.

    • For Windows 8, place your mouse cursor in the top-right corner of the screen, then click the magnifying glass icon when it appears.
  2. Image titled Change Directories in Command Prompt Step 2

    2

    Type in cmd. This will bring up the Command Prompt icon at the top of the Start window.

    Advertisement

  3. Image titled Change Directories in Command Prompt Step 3

    3

    Right-click Command Prompt. It resembles a black box. This invokes a drop-down menu.

  4. Image titled Change Directories in Command Prompt Step 4

    4

    Click Run as administrator. It’s near the top of the drop-down menu. Doing so will open Command Prompt with administrator privileges.

    • Confirm this choice by clicking Yes when prompted.
    • You won’t be able to run Command Prompt in administrator mode if you’re on a restricted, public, or networked computer (e.g., a library or school computer), or an otherwise non-administrator account.
  5. Advertisement

  1. Image titled Change Directories in Command Prompt Step 5

    1

    Type in cd . Make sure you include the space after «cd». This command, which stands for «change directory», is the root of any directory change.

    • Don’t press the Enter key.
  2. Image titled Change Directories in Command Prompt Step 6

    2

    Determine your directory’s path. A directory path is like a map to a specific folder. For example, if the directory to which you want to change is the «System32» folder that’s in the «WINDOWS» folder on the hard drive, the path would be «C:WINDOWSSystem32».

    • You can find a folder’s path by opening My Computer, double-clicking the hard drive icon, navigating to your destination, and then looking at the address at the top of the folder.
  3. Image titled Change Directories in Command Prompt Step 7

    3

    Type in your directory’s path. Your command or address goes after the «cd» command; make sure there is a space between «cd» and your command.

    • For example, your whole command might look like cd WindowsSystem32 or cd D:.
    • Since your computer’s default directory location will be the hard drive (e.g., «C:»), you don’t need to type in the hard drive’s name.
  4. Image titled Change Directories in Command Prompt Step 8

    4

    Press Enter. Doing so will change the Command Prompt directory to your selected one.

  5. Advertisement

Add New Question

  • Question

    How do I go to C: from C:usersusername?

    Community Answer

    You can either type «cd ..» to take you up a directory level (to C:users) and once again to take you to the root level, or you can always type «cd » from any directory to take you to the root level.

  • Question

    How do I change the name of a drive, like from Drive H: to drive A:?

    Community Answer

    In start, type Computer Management. Open Computer Management and click the arrow next to Storage, then Disk Management. Right-click the drive you want to rename and click Change Drive Letter.

  • Question

    What is the difference between cd and cd?

    Community Answer

    In order to use cd you have to put a file path after it; cd just goes straight to C:.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • Changing the directory is useful when attempting to modify or delete a file in a specific location.

  • Some common Command Prompt directory commands include the following:

    • D: or F: — Change the directory to the disk drive or an attached flash drive.
    • .. — Move the current directory up by one folder (e.g., «C:WindowsSystem32» to «C:Windows»).
    • /d — Changes the drive and the directory at the same time. For example, if Command Prompt is in the disk drive («D:»), typing «cd /d C:Windows» would move you to the Windows directory on the hard drive («C:»).
    • — Takes you to the root directory (e.g., the hard drive).

Thanks for submitting a tip for review!

Advertisement

  • Attempting to run a command that is contingent on a specific file or folder while in a different directory will result in errors.

Advertisement

About This Article

Article SummaryX

1. Open Command Prompt.
2. Type in cd followed by a space.
3. Type in your preferred directory command or path.
4. Press Enter.

Did this summary help you?

Thanks to all authors for creating a page that has been read 2,433,100 times.

Is this article up to date?


Download Article


Download Article

This wikiHow teaches you how to change the folder (also known as the «directory») in which your Windows computer’s Command Prompt program operates. To make changes in Command Prompt, you must be using an administrator account.

Things You Should Know

  • Open start and type cmd. Right click Command Prompt and click Run as administrator.
  • Type cd and enter your directory’s path. The path can be found by looking at the address at the top of the folder you are directing to.
  • Press Enter.
  1. Image titled Change Directories in Command Prompt Step 1

    1

    Open Start. Either click the Windows logo in the bottom-left corner of the screen, or press the Win key.

    • For Windows 8, place your mouse cursor in the top-right corner of the screen, then click the magnifying glass icon when it appears.
  2. Image titled Change Directories in Command Prompt Step 2

    2

    Type in cmd. This will bring up the Command Prompt icon at the top of the Start window.

    Advertisement

  3. Image titled Change Directories in Command Prompt Step 3

    3

    Right-click Command Prompt. It resembles a black box. This invokes a drop-down menu.

  4. Image titled Change Directories in Command Prompt Step 4

    4

    Click Run as administrator. It’s near the top of the drop-down menu. Doing so will open Command Prompt with administrator privileges.

    • Confirm this choice by clicking Yes when prompted.
    • You won’t be able to run Command Prompt in administrator mode if you’re on a restricted, public, or networked computer (e.g., a library or school computer), or an otherwise non-administrator account.
  5. Advertisement

  1. Image titled Change Directories in Command Prompt Step 5

    1

    Type in cd . Make sure you include the space after «cd». This command, which stands for «change directory», is the root of any directory change.

    • Don’t press the Enter key.
  2. Image titled Change Directories in Command Prompt Step 6

    2

    Determine your directory’s path. A directory path is like a map to a specific folder. For example, if the directory to which you want to change is the «System32» folder that’s in the «WINDOWS» folder on the hard drive, the path would be «C:WINDOWSSystem32».

    • You can find a folder’s path by opening My Computer, double-clicking the hard drive icon, navigating to your destination, and then looking at the address at the top of the folder.
  3. Image titled Change Directories in Command Prompt Step 7

    3

    Type in your directory’s path. Your command or address goes after the «cd» command; make sure there is a space between «cd» and your command.

    • For example, your whole command might look like cd WindowsSystem32 or cd D:.
    • Since your computer’s default directory location will be the hard drive (e.g., «C:»), you don’t need to type in the hard drive’s name.
  4. Image titled Change Directories in Command Prompt Step 8

    4

    Press Enter. Doing so will change the Command Prompt directory to your selected one.

  5. Advertisement

Add New Question

  • Question

    How do I go to C: from C:usersusername?

    Community Answer

    You can either type «cd ..» to take you up a directory level (to C:users) and once again to take you to the root level, or you can always type «cd » from any directory to take you to the root level.

  • Question

    How do I change the name of a drive, like from Drive H: to drive A:?

    Community Answer

    In start, type Computer Management. Open Computer Management and click the arrow next to Storage, then Disk Management. Right-click the drive you want to rename and click Change Drive Letter.

  • Question

    What is the difference between cd and cd?

    Community Answer

    In order to use cd you have to put a file path after it; cd just goes straight to C:.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • Changing the directory is useful when attempting to modify or delete a file in a specific location.

  • Some common Command Prompt directory commands include the following:

    • D: or F: — Change the directory to the disk drive or an attached flash drive.
    • .. — Move the current directory up by one folder (e.g., «C:WindowsSystem32» to «C:Windows»).
    • /d — Changes the drive and the directory at the same time. For example, if Command Prompt is in the disk drive («D:»), typing «cd /d C:Windows» would move you to the Windows directory on the hard drive («C:»).
    • — Takes you to the root directory (e.g., the hard drive).

Thanks for submitting a tip for review!

Advertisement

  • Attempting to run a command that is contingent on a specific file or folder while in a different directory will result in errors.

Advertisement

About This Article

Article SummaryX

1. Open Command Prompt.
2. Type in cd followed by a space.
3. Type in your preferred directory command or path.
4. Press Enter.

Did this summary help you?

Thanks to all authors for creating a page that has been read 2,433,100 times.

Is this article up to date?

После запуска приглашение командной строки показывает текущий каталог. По умолчанию, это каталог профиля текущего пользователя. Для смены текущего каталога используется специальная команда CD.

Команда CD. Смена текущего каталога.

Для того чтобы перейти из текущего каталога в другой каталог используется команда cd. Команда имеет следующий синтаксис:CD [/D] [диск:][путь][..].
Команда для перехода в корневой каталог текущего диска выглядит так: cd

cd

Для того чтобы перейти в один из каталогов диска «C» используется команда: cd [каталог]
Например, зайдем в папку «Program Files»: cd program files

cd.

Для перехода из одного каталога диска «C» в другой каталог диска «C» используется команда: cd [каталог]
Например, зайдем из папки «Program Files» в папку «Windows»: cd windows

cd..

Для перехода из каталога в подкаталог используется команда: cd [каталог]
Например, зайдем из папки «Windows» в папку «Fonts», расположенную в папке «Windows»: cd fonts

cd...

Можно сразу перейти в папку «Fonts» из корневого каталога диска «C»: cd [каталог/подкаталог]
Например, перейдем в корень диска «C» с помощью команды cd, а затем перейдем в папку «Fonts»:
cd windows/fonts

cd....

Чтобы перейти из текущего подкаталога в родительский каталог применяется команда cd..

cd.....

Для перехода из текущего подкаталога в другой каталог, который не является родительским по отношению к текущему каталогу, применяется команда: cd [каталог].
Например, перейдем в папку «Fonts» (cd fonts), а затем в папку «Program Files»: cd program files

cd......

Таким образом, из вышесказанного следует вывод:

  • Для перехода в корень диска применяется команда cd
  • Для перехода в любой каталог диска применяется команда cd [каталог] (из корня диска) и команда cd [каталог] (из любого каталога или подкаталога).
  • Для перехода в подкаталог применяется команда cd [каталог] (из каталога) и команда cd [каталог/подкаталог] (из корня диска).

В случае если необходимо поменять не только текущий каталог, но и текущий диск, необходимо использовать ключ /D. Команда будет выглядеть так: cd /D [диск:/].
Например, перейдем из папки «Program Files», расположенной на диске «C», на диск «D»: cd /D d:/

cd.......

Теперь с диска «D» перейдем в папку «Fonts», расположенную в папке «Windows» на диске «C»:
cd /D c:/windows/fonts

cd........

Команда СD может записываться как СHDIR. CD и CHDIR являются аналогичными командами и обе являются сокращениями от англ. «change directory» — поменять каталог.


Предыдущая статья: Перенаправление ввода-вывода и конвейеризация.
Оглавление: Командная строка.
Следующая статья: Команда MKDIR и RMDIR для создания и удаления каталога.


Понравилась статья? Поделить с друзьями:
  • Переустановка windows 10 на lenovo thinkcentre
  • Переход в защищенный режим windows 7
  • Переустановка windows 10 бесплатно без регистрации
  • Переход в биос на windows 10
  • Переустановка windows 10 home на ноутбуке