How to Change Directory on Command Line: 8 Steps

Table of contents:

How to Change Directory on Command Line: 8 Steps
How to Change Directory on Command Line: 8 Steps

Video: How to Change Directory on Command Line: 8 Steps

Video: How to Change Directory on Command Line: 8 Steps
Video: How to Make a Multiplication Mosaic in Excel : Using Microsoft Excel 2024, July
Anonim

This wikiHow teaches you how to change the folder (also known as the "directory") where we execute programs through the Command Prompt in Windows. To make changes within the Command Prompt, you must use an administrator account.

Step

Part 1 of 2: Open Command Prompt

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

Step 1. Click Start

Start by clicking the Windows logo in the lower-left corner of the screen, or pressing the Win key.

For Windows 8, place the mouse cursor in the upper-right corner of the screen, then click the magnifying glass icon when it appears

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

Step 2. Type "cmd"

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

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

Step 3. Right-click the Command Prompt icon

The shape is like a black box. This step will bring up a drop-down menu.

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

Step 4. Click Run as administrator

It's located at the top of the menu to the bottom. With this step you will open Command Prompt with administrator access.

  • Confirm by clicking option Yes when it appears.
  • You will not be able to run Command Prompt in administrator mode if you are on a restricted public computer, or a network-connected computer (for example, a library or school computer), or without an administrator account.

Part 2 of 2: Changing Directory

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

Step 1. Type in cd

Make sure to type a space after "cd". This command, which stands for "change directory", is the root of all directory changes.

Do not press Enter key

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

Step 2. Specify the address of your destination directory

A directory address is a kind of map to a specific folder. For example, if you want to move to the "System32" folder which is in the "WINDOWS" folder on your hard disk, the address is "C:\WINDOWS\System32\".

You can search for folders by going to My Computer; double-click the hard disk icon, locate the destination folder, then look at the address at the top of the folder

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

Step 3. Type in the desired address

Type the new command or address after the "cd" command; make sure there is a space between "cd" and the command entered.

  • For example, the command you enter is cd Windows\System32 or cd D:.
  • Because your computer's default directory is on the hard disk (for example, "C:"), you do not need to type the hard disk name.
Change Directories in Command Prompt Step 8
Change Directories in Command Prompt Step 8

Step 4. Press Enter

This step will change the Command Prompt directory to the directory you chose.

Tips

  • The change directory step can be used when trying to change or delete a file at a specific location.
  • Some common directory commands in the Command Prompt are as follows:

    • D: or F: - Changes directory to disk drive or USB.
    • .. - Change the directory to move up one level to the directory above it (for example, "C:\Windows\System32" to "C:\Windows").
    • /d - Moves both drives and directories at the same time. For example, if Command Prompt is on the disk drive ("D:"), enter "cd /d C:\Windows" to move to the Windows directory on the hard disk ("C:").
    • - Returns to the root directory (for example, hard disk).

Recommended: