1. Home
  2. Windows Tips
  3. Create a shortcut to open command prompt in a folder on windows 10

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.

1 Comment

  1. That’s the long and hard way to do it. First of all, if you’re using the full path in the CD command, you don’t need to perform CD\ first.

    Second, instead of adding syntax to the “Target” field, simply place the full path of the folder you want into the “Start In” field. It doesn’t even have to be a location on your Windows drive. Your Windows drive could be C: and you could specify location L:\Video, and as long as that drive and location actually exist, that’s where the command prompt will open. And if that drive and/or location doesn’t exist, it will default to C:\Windows\System32.