The command line is an incredibly useful way to accomplish certain tasks. For example, if you want to run a program with special parameters, the command line is one quick way to do this. The problem is that navigating the directory structure on a modern computer can be a real problem when using the command line. Moreover, Windows 10 supports such long folder and program names.
The good news is that you can open Command Prompt right from the Windows Explorer window. Takes you directly to this folder!
Command Prompt in Folder Using Windows Explorer”/>
Command Prompt vs. PowerShell
The important point when opening a command prompt in a folder is that we mean the Windows command prompt, not PowerShell Although both programs look the same because they are a text-only interface, they are actually very different.
Command Prompt is a simple and lightweight text-based interface for Windows. In contrast, PowerShell is a sophisticated and powerful command line tool that enables power users to perform comprehensive system management on a computer, among a long list of other useful features.
Command Prompt in Folder Using Windows Explorer”/>
The command line uses “CMD.exe” and PowerShell uses “powershell.exe”, so they are completely separate. Although some functions overlap, two programs can use different commands to perform the same task. This article is only for the command line, but some keyboard shortcuts will also work with PowerShell We will let you know when this happens.
Open a command prompt using the explorer address bar
When you open the Windows Explorer folder, you see an address bar similar to the one in a web browser. By default, the path to the current folder is displayed. You can see it here.
– /
Command Prompt in Folder Using Windows Explorer”/>
If you click on this address bar, you can enter text. By typing “cmd” and pressing Enter, you will open a command prompt at that location.
Command Prompt in Folder Using Windows Explorer”/>
This also works if you type powershell instead of cmd. You will be taken directly to the Windows PowerShell command prompt in that folder.
Add “open command window here”
In earlier versions of Windows 10, there was a context menu item called “Open a command window here” that opened a command prompt in the folder you specified. For example, if you right-click a folder and use this command, the command prompt will run at the current folder location.
After the Creator’s Update 2017 for Windows 10 was released, Microsoft removed this option. Why? This is most likely due to Microsoft’s attempt to alienate people from using the command line in favor of PowerShell
Getting this command back is not very difficult, but it does take a little bit of work in the Windows Registry. If you’re not comfortable doing this, it’s best to skip this method, but if you really want to revert this context menu option, here’s what to do.
First click Start and type regedit. Then click the regedit program entry.
Command Prompt in Folder Using Windows Explorer”/>
In an open Registry Editor, find the following registry key under this path:
HKEY_CLASSES_ROOT Directory shell cmd
Command Prompt in Folder Using Windows Explorer”/>
Everything here may seem a little risky, but we are not doing anything that could break your computer. But be sure to follow these exact instructions!
Right-click a section and select Permissions from the context menu.
Command Prompt in Folder Using Windows Explorer”/>
In the dialog box that opens, click “Advanced”.
Command Prompt in Folder Using Windows Explorer”/>
At the top of the advanced settings window, you will see the specified key owner. Click the “Change” button.
Command Prompt in Folder Using Windows Explorer”/>
Then enter your username and click “Check Names” to confirm it. Then click OK.
Command Prompt in Folder Using Windows Explorer”/>
Finally, before clicking OK, make sure the Replace Owner of Subcontainers and Objects check box is selected.
Command Prompt in Folder Using Windows Explorer”/>
We are now back on the permissions page. Select Administrators under Group or Usernames and select Allow next to Full Control. Then click OK.
Command Prompt in Folder Using Windows Explorer”/>
Now we need to restore the context menu item for the command line.
Back in the CMD window, all we need to do is change the “DWORD” from “HideBasedOnVelocityiD” to “ShowBasedOnVelocityId”. Just right click it and select rename, then change the DWORD name.
Command Prompt in Folder Using Windows Explorer”/>
If everything went according to plan, you should see the “Open Command Window Here” option when you SHIFT + right-click an item in a Windows Explorer window.
Command Prompt in Folder Using Windows Explorer”/>
Open a command prompt using Windows Explorer
The next method to open a command prompt from a Windows Explorer window involves navigating to where the command prompt program itself is stored and launching it directly from there. This is still useful when, for one reason or another, other ways to open the command line do not work.
Command Prompt in Folder Using Windows Explorer”/>
You can find “cmd.exe” in C: Windows System32. If you want to run it as administrator, just right click on cmd.exe and select Run as administrator. There are many commands that require administrator rights to run, and this is one way to run a command prompt with these privileges without leaving File Explorer.
You are in command now!
As with HyperTerminal, Microsoft may one day ditch the command line entirely in favor of PowerShell While this is fine in and of itself, PowerShell could be tweaked a bit to help inexperienced users who would be good at command line use common functions just as easily. However, until the Command Prompt follows the Dodo path, you can rest assured that it is only a few clicks away.
If you need to improve your command line skills, why not check out these 21 Commands Every Windows User Should Know. You will complete tasks in no time, armed with these incredibly useful tricks.
–