How to navigate directories using the command line

Table of contents:

How to navigate directories using the command line
How to navigate directories using the command line
Anonim

This article explains how to change to a different folder (directory) in the Windows command prompt. To work with the command line, you must use an administrator account.

Steps

Part 1 of 2: How to open a command prompt

Change Directories in Command Prompt Step 1
Change Directories in Command Prompt Step 1

Step 1. Open the Start menu

To do this, click on the Windows logo in the lower left corner of the screen, or press the ⊞ Win key on your keyboard.

In Windows 8, move your mouse to the upper-right corner of the screen and click the magnifying glass that appears

Change Directories in Command Prompt Step 2
Change Directories in Command Prompt Step 2

Step 2. In the search bar, enter Command Prompt

The command line utility icon appears above the search bar.

Change Directories in Command Prompt Step 3
Change Directories in Command Prompt Step 3

Step 3. Right click on the command line icon

It looks like a black square. A context menu will open.

Change Directories in Command Prompt Step 4
Change Directories in Command Prompt Step 4

Step 4. Click Run as administrator

This option is at the top of the drop-down menu. A command prompt will open with administrator rights.

  • In the window that opens with a proposal to confirm your actions, click "Yes".
  • You cannot run Command Prompt as an administrator if you are using a restricted computer, located in a public place or connected to a local network (for example, in a library or at a school), that is, if you are using a guest account recording.

Part 2 of 2: How to change directory

Change Directories in Command Prompt Step 5
Change Directories in Command Prompt Step 5

Step 1. Enter cd

Be sure to add a space after the "cd". This command, which is short for "change directory", is the main command for changing directory.

Do not press the ↵ Enter key

Change Directories in Command Prompt Step 6
Change Directories in Command Prompt Step 6

Step 2. Determine the path to the required directory

The directory path is like a directory listing. For example, if the directory you want is the System32 folder located in the WINDOWS folder on the system drive, the path will be C: \ WINDOWS \ System32 \.

To find out the path to a folder, open My Computer, double-click the hard drive icon, navigate to the desired folder, and then copy the information from the address bar of Explorer (above)

Change Directories in Command Prompt Step 7
Change Directories in Command Prompt Step 7

Step 3. Enter the path to the directory

Do this after the "cd" command. Make sure there is a space between "cd" and the directory path.

  • For example, the command might look like cd Windows \ System32 or cd D:.
  • By default, all folders are located on the hard drive (for example, "C:"), so you do not need to enter a hard drive letter.
Change Directories in Command Prompt Step 8
Change Directories in Command Prompt Step 8

Step 4. Press ↵ Enter

This will take you to the correct directory.

Advice

  • You need to change the directory to edit or delete the file.
  • Some common commands for working with directories are as follows:

    • D: or F: - change directory to floppy drive or attached flash drive.
    • .. - move up one folder from the current directory (for example, from "C: \ Windows \ System32" to "C: \ Windows").
    • / d - change drive and directory at the same time. For example, if you are in the root directory of the "D:" drive at the command prompt, enter "cd / d C: \ Windows" to navigate to the "Windows" folder on the "C:" drive.
    • \ - go to the root directory (for example, the system drive).

Popular by topic