How to Change Command Prompt Default Directory

If you want to change the default directory in the Windows 10 Command Prompt, then follow these steps:

Open Registry Editor. I suggest you take a Registry backup before proceeding.

Go to HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Command Processor.

Right-click on the blank space in the right pane.

Select New > String Value.

Provide the name as Autorun and then hit the Enter key. Double-click it.

Provide the cd /d and then the directory path you want in the Value data field. I want to set up the Windows directory and this is what I should enter: cd /d c:\windows

Hit the OK button.

That’s all. Check the change by launching Command Prompt.

To revert, just delete the String Value you’ve created above.

If you have a Command Prompt shortcut on your desktop and you want the Command Prompt to open in a specific directory while using the shortcut, you can follow these steps:

Right-click on the shortcut.

Hit Properties.

In the Shortcut tab, you will find the Start in field.

Enter the directory path you want in that field.

Hit the OK button.

From now on, whenever you use the shortcut, the Command Prompt will open in the directory you set.

Other methods to launch Command Prompt will open in the default directory.

Remember that when you use this shortcut to open Command Prompt as an administrator, it’ll open in the default directory and not the directory you set.