How to change starting directory on Windows Terminal

Do you want to start a Windows Terminal command in a different directory? Here's how to do it using the settings UI and settings.json.

Windows Terminal change starting directory
Windows Terminal change starting directory

Windows Terminal lets you change the starting directory for any available command-line tool, and in this guide, you will learn how to complete this task.

On Windows 10, the Windows Terminal app is the new modern command-line experience to run Command Prompt, PowerShell, and Linux commands.

By default, you will always start in your profile location (%USERPROFILE%) when using the app. However, if you always change the directory to start running commands, Windows Terminal allows you to set a different working directory using the Settings UI or settings.json file.

In this guide, you will learn the steps to change the starting directory for any command-line tool available in the Windows 10 terminal experience.

Change starting directory using Windows Terminal settings UI

To change the starting directory for Command Prompt, PowerShell, or WSL2 distros, use these steps:

  1. Open Windows Terminal.

  2. Use the Shift +  Ctrl + , (comma) keyboard shortcut to open the settings UI.

    Quick note: This option is available starting version 1.6. You can use these steps to enable the settings interface on your computer.
  3. Click on Windows PowerShell, Command Prompt, or WSL distro, depending on the console you want to configure.

  4. Click the General tab.

  5. Under the “Starting directory” section, click the Browse button.

    Change starting directory option
    Change starting directory option
  6. Select the location – for example, C:\.

  7. Click the Select Folder button.

  8. Click the Save button in the bottom-right corner.

Once you complete the steps, the next time you open the command-line tool, it will open in the specified directory.

Change starting directory using Windows Terminal settings.json

To change the starting directory using the settings.json file, use these steps:

  1. Open Windows Terminal.

  2. Use the Ctrl + Alt + , (comma) keyboard shortcut to open the settings.json file with the default code editor.

    Quick tip: It is recommended to use Visual Studio Code. You can also open the file by clicking the menu (down-arrow) button next to the tab and selecting the Settings option.
  3. Under the “profiles” section, inside the brackets of the profile (cmd.exe, powershell.exe, or Windows.Terminal.Wsl) you want to update, type the following command to change the starting directory:

    "startingDirectory": "C:\\"
    StartingDirectory settings.json
    StartingDirectory settings.json

    In the command, make sure to change the “C:\\” for the path you want to start the command-line tool. Also, notice the extra “\” that is required to specify the setting.

    Quick tip: If you have more than one line of code inside the bracket, make sure all the lines end with a comma (,) except for the last line. Otherwise, the settings may not save correctly.
  4. Use the Ctrl + S keyboard shortcut to save the file.

After you complete the steps, the settings will save, and the next time, the command-line tool will launch in the new path.

About the author

Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade. Mauro has over 15 years of experience writing comprehensive guides and creating professional videos about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 21 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and About.me. Email him at [email protected].