1. Home
  2. Windows

How to create a shortcut to open Command Prompt in a folder on Windows 10

You can move Command Prompt to any folder of your choice with the cd command. You can also open a command prompt window directly to a folder by typing cmd in the location bar in File Explorer. If the cd command seems tedious, and you don’t want to open File Explorer, you can create a shortcut to open command prompt in a folder. With the shortcut, you can open command prompt in a folder with a double-click.

Shortcut to open Command Prompt in folder

Command prompt can be run with normal user rights, and with admin rights. You can create a shortcut for either one but, the process will be slightly different.

First, you need to create a shortcut to the command prompt. The easiest way to do this is to find Command Prompt in the apps list in the Start menu or search for it in Windows Search. Drag the search result out and drop it on to the desktop (make sure the desktop icons are visible).

Once you’ve created the command prompt shortcut, you can change what folder it opens to. Here, we’re going to differentiate the process for opening the command prompt as a normal user and as an admin.

Open as ordinary user

This is the easier one to set up. Right-click the Command Prompt shortcut and select Properties from the context menu. On the Properties window, go to the Shortcut tab. In the ‘Start in’ field, enter the complete path to the folder you want to open it in. Click Apply and close the window. When you double-click the shortcut, it will open Command Prompt to the folder.

Open as Admin

Right-click the Command Prompt shortcut and select Properties from the context menu. On the Properties window, go to the Shortcut tab. This time, we’re going to edit the Target field.

Use the following command if the directory that you want to open Command Prompt to is on the same drive as your Windows drive.

Syntax

%windir%\system32\cmd.exe /k " cd\ & cd "Complete-path-to-folder"

Example

%windir%\system32\cmd.exe /k " cd\ & cd c:\Users\fatiw\OneDrive\Pictures\Screenshots

If the folder is on a different drive, use the command below.

Syntax

%windir%\system32\cmd.exe /k " cd\ & Drive-letter: & cd "Complete-path-to-folder"

Example

%windir%\system32\cmd.exe /k " cd\ & d: & cd d:\Desktop\Scripts

Click Apply. You can now right-click the shortcut and select the Run as administrator option or you can set the shortcut to always run as administrator. You can do that by clicking the ‘Advanced’ button on the Shortcut tab on the Properties window and selecting the always run as admin option.

Leave a comment