Windows Tip - Quick Way to Open CMD in Directory

Posted by sfc12345 on Fri, 17 May 2019 21:31:11 +0200

There are often situations where cmd is needed in a folder, such as running a script. Here are several ways to do this.

Take the following directory operations as an example:

Mode 1: Common cd commands

The cd command is the most common way we use it:

  1. Win+R opens the cmd window, which is displayed as follows by default (non-administrator mode);

  2. At this point, you need to type the command e: cd github cd anyer cd Wechat-Weapp in turn

Or e: CD github anyer WeChat-WeApp\

Or CD E:githubanyerWeChat-WeApp\

3. Operation.

Way 2: Quick way to right mouse button

Obviously experienced the above commands, is it very sad, the following is a quick way:?
1.Win+E Resource Manager quickly enters the specified directory;

2.Shift + Right Mouse Presence Options Menu

Select to open the command window (W) item here.

3. Operation.

The above method only supports the cmd of the current user (non-administrator) privileges. When administrator privileges are needed, you can try the following method.

Add the administrator mode to run the command line window, use the following code, copy the code, save as any name. reg, that is, save as a registry file.

Windows Registry Editor Version 5.00

; Created by: Shawn Brink

; http://www.sevenforums.com

; Tutorial: http://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html

[-HKEY_CLASSES_ROOT\Directory\shell\runas]

[HKEY_CLASSES_ROOT\Directory\shell\runas]

@="Open cmd here as Admin"

"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]

@="cmd.exe /s /k pushd \"%V\""

[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

@="Open cmd here as Admin"

"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]

@="cmd.exe /s /k pushd \"%V\""

[-HKEY_CLASSES_ROOT\Drive\shell\runas]

[HKEY_CLASSES_ROOT\Drive\shell\runas]

@="Open cmd here as Admin"

"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Drive\shell\runas\command]

@="cmd.exe /s /k pushd \"%V\""

After saving, double-click the file, that is, add the option by right-clicking:

When you want to delete the right-click menu options, you can use the following command, copy and save as any name. reg, double-click to run.

  Windows Registry Editor Version 5.00

  ; Created by: Shawn Brink

  ; http://www.sevenforums.com

  ; Tutorial: http://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html

  [-HKEY_CLASSES_ROOT\Directory\shell\runas]

  [-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

  [-HKEY_CLASSES_ROOT\Drive\shell\runas]

Mode 3: Resource Manager (2017-08-08 increase)

After entering cmd or powershell in the address bar of resource manager, you can still quickly open the command line window in the current directory:

1. Enter the specified directory

2. Enter cmd or powershell in the address bar

3. Return confirmation

Mode 4: git command line

This approach uses git users to install git by determining the GIT bash command line to ensure that git operations can be completed on the command line. The installation of GIT tutorials under windows has made Baidu its own. Once installed, use git bash instead of cmd in directories that need to be used.
1. The resource manager enters the specified directory.
2. Right mouse button, select Git Bash Here item in menu item;

3. Operation;

Other ways, after follow-up information to supplement~

Topics: Windows shell git github