HOW TO

Simple Way To Change the Default Directory in Windows Terminal

How to Change the Default Directory in Windows Terminal
Simple Way To Change the Default Directory in Windows Terminal.

Windows Terminal uses your current user directory because the default directory once you open it. However, you’ll change this to any directory on your Windows PC. We’ll show you ways to vary the default working directory for PowerShell, prompt , and Ubuntu shell.

Change PowerShell’s Default Directory in Windows Terminal
PowerShell is that the default shell that opens once you launch Windows Terminal. Like other shells, this one uses your current user directory because the default.

You can change this default directory by adding one line of code within the Windows Terminal’s settings file.

To do this, open the “Start” menu, look for “Windows Terminal,” and click on the app within the results.
Open Windows Terminal
Click the down-arrow icon at the highest of the Windows Terminal window, then select “Settings.”
Access Windows Terminal settings
Windows will ask what app you would like to open the settings file with. you’ll choose any code (or plain-text) editor within the list, but we’ll persist with Notepad for the sake of simplicity. Click “Notepad” within the list and hit “OK.”

Open Windows Terminal's settings in Notepad
When the settings file opens in Notepad, scroll to the “Make changes here to the powershell.exe profile” section.

Put your cursor at the top of the last value during this section and sort a , (comma).

For example, if the last value therein section was:

"Hidden": false

It would now look like this (See the comma at the end.):

"Hidden": false,

Add a comma after a value in Windows Terminal

Now, press Enter to add a new line. Type the following code in this line, replacing PATH with the path to your new default directory.

Make sure that your directory path is enclosed with double quotes. Also, where you have a single slash in the path, make it a double slash.

"startingDirectory": "PATH"

For instance, to set your desktop as the default directory, you’d type the following line of code in the settings file (replacing “Username” with your username):

"startingDirectory": "C:\\Users\\Username\\Desktop"

Change PowerShell's default directory

After entering the path, click File > Save in Notepad to save your changes.

Save Windows Terminal settings

Now, when you open a new PowerShell tab in Windows Terminal, it’ll use your newly specified directory as the default directory.

Change Command Prompt’s Default Directory in Windows Terminal

You can change Command Prompt’s default directory using the same steps as those listed above. The only difference is that you need to add the new directory path in the Command Prompt section of the settings file.

To do this, open Windows Terminal’s settings like you did previously.

Scroll down to the “Make changes here to cmd.exe profile” section.

Put your cursor after the last value in this section, and type a , (comma). Press Enter to add a new line and type the following. Be sure to replace PATH with your new directory path.

"startingDirectory": "PATH"

Change Command Prompt's default directory

Select File > Save in Notepad to save your changes.

Change Ubuntu’s Default Directory in Windows Terminal

You can use the same line of code that you used above to change Ubuntu’s (Linux) default directory in Windows Terminal.

To do this, open the Windows Terminal’s settings file.

Scroll to the section where it says “Name : Ubuntu.”

Put your cursor after the last value in this section and add a , (comma).

Press Enter to add a new line and type this code in that line. Replace PATH with the path to your new default directory.

"startingDirectory": "PATH"

Change Ubuntu's default directory

In your Notepad window, click File > Save to save your changes.

How to Reset the Default Directory in Windows Terminal

To revert to the original default directory in Windows Terminal, you just need to remove your newly added code from the settings file.

Start by opening Windows Terminal and then launching the settings file.

Scroll to the shell that you want to reset the default directory for.

Use your mouse to highlight the entire line of code that you added previously, then press Backspace to delete that line.

Reset the default directory in Windows Terminal

Also, make certain to get rid of the , (comma) that you simply added to the top of the last value therein section.

Finally, click File > Save in Notepad to save lots of your changes.

TO WATCH THE VIDEO TAP HERE AND CLICK "SUBSCRIBE"

You’re ready .

Do you like Winnaijablog? We count on you! Follow us on Googlenews, And get 1k. Click Here, and Click the Star.
JOIN OUR WHATSAPP GROUP FOR LATEST NEWS UPDATES 247🔥 (CLICK HERE)
SUBSCRIBE TO OUR YOUTUBE CHANNEL HERE FOR VIRAL VIDEOS IS FREE
Follow Us On Twitter For Free Give Away Daily (CLICK HERE)
Join Our Facebook Group & Get Unlimited Likes On Your Post (CLICK HERE)
Click to comment

Leave a Comment Here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To Top