Windows right click cmd

How do I get a right-click command line for a folder? [duplicate]

I want to be able to right click on a folder called (C:\myFolder) and have a command prompt open like this.

Is this possible?

2 Answers 2

How to open a command prompt from Windows Explorer

In previous versions of Windows like XP/2000 you needed to run TweakUI to get that from the context menu.

However since Windows 7 and 8 you simply hold Shift key when you right-click.

Its easy to hold Shift key when you right-click and you will have the open command window here.

There are numerous posts online regarding how to insert this same functionality into the default right-click context menu with registry hacks and all kinds of nonsense that will allow you to do this without the need to Shift.

I just use the shift + right click trick and move on with my life. I’d advise most end users to stay out of the registry unless they know what they’re doing.

Shift-click works only on folders and answers the original question. However you can have the same effect even on files in all versions of Windows (NT,2000,XP and later). I’ve used this solution on folders and files in explorer. More importantly, it even works inside of File Selection dialogs; anywhere a windows file context menu can come up. It also does not require a registry change.

In your «SendTo» folder you can either make a batch file called «LaunchCMDAtThisFileOrFolder.Bat». The location of «SendTo» is different by Windows version. See this for XP and this for Vista & 7, 8 or this. If you like code then this might be interesting

The batch file will have the following code.

Now you can right-click any file and «Send To» -> «LaunchCMDAtThisFileOrFolder».

Here’s an example of a Standard Windows Dialog where you can use this. Note, the context menu is on a file, not a folder as it works on both.

Here’s an example of a Non Standard Windows File Listing where this can be used.

How the batch file works.. Reference Windows command line help, specifically the FOR command http://www.robvanderwoude.com/allhelpw2ksp4_en.php#FOR

d1 translates to drive letter of the first parameter to the batch file.
CD %

dp1 translates to CD «path of the first parameter».
CMD /K runs the CMD.exe. The /K parameter is needed inside a batch file specifically, otherwise CMD.exe will automatically close.

PS: I +1’d MDT Guy’s answer because I learnt a new shortcut.

Ways to open Command Prompt in a folder in Windows 10

The Command Prompt is a feature of Windows that lets you execute MS-DOS and other computer commands and perform tasks on your computer without using the Windows graphical interface. There are various ways how you can launch Command Prompt windows.

Читайте также:  Запуск сампа windows 10

Open a command prompt window in any folder

In this post, we will see two very simple ways to open a command prompt window in any folder or on the desktop, without having to navigate the menu. The first is using the context menu.

1] Hold down the Shift key and use the context menu

UPDATE: Windows 10 has now replaced Open command window here with Open PowerShell window here. But with a registry tweak, you can restore Open command window here item to Windows 10 folder context menu.

To open a command prompt window in any folder, simply hold down the Shift key and right-click on the desktop. In the context menu, you will see the option to Open command window here. Clicking on it will open a CMD window.

You can also do the same inside any folder. The prompt takes the path of the folder from where it is opened.

2] Type CMD in the address bar

There is another trick to do the same thing. navigate to the folder and then simply type CMD in the address bar and hit Enter to open the command prompt window there.

You will see the CMD taking the path of this folder.

Speaking of the command prompt, there are several Command Prompt tricks you may not know, including how to open an elevated command prompt using a CMD. Check them out!

Date: April 8, 2020 Tags: CMD, Context Menu

Is there a way to disable right click menu in cmd? [closed]

Want to improve this question? Update the question so it’s on-topic for Stack Overflow.

Closed 1 year ago .

I’m writing a mouse input to console game engine, but context menu pops up every time I press right mouse button and messes my events.

Input in my program is processed by a child window, attached to console:

Note: instance of this window is being created in another thread.

Although I give a focus to this window to receive input, right mouse button still produces events for the console and produces context menu.

Right now I’m processing RAWMOUSEINPUT and get WM_INPUT messages to my window. This is done because I needed somewhat close to GetMouseRelative() in DirectInput to make a rotating camera.

Console window serves for me as a graphics output.

Is there any way to disable parent window input processing? Or what can cause such behaviour, as input from mouse is being processed by two windows?

2 Answers 2

You can disable the right mouse button of the console by customizing mouse input messages to achieve this goal.

It should be noted that,to add ENABLE_EXTENDED_FLAGS (Enabling or disabling extension flags is necessary).

This is not added in the MSDN sample, only after adding can the mouse message be processed.

In addition, if you want to disable the title bar of the console, you can refer to the following code.

You would have to hook the SetFocus function, or otherwise specify that WM_KILLFOCUS should not apply to the command prompt window you’re using.

The SetFocus function sends a WM_KILLFOCUS message to the window that loses the keyboard focus and a WM_SETFOCUS message to the window that receives the keyboard focus. It also activates either the window that receives the focus or the parent of the window that receives the focus.

If a window is active but does not have the focus, any key pressed will produce the WM_SYSCHAR, WM_SYSKEYDOWN, or WM_SYSKEYUP message. If the VK_MENU key is also pressed, the lParam parameter of the message will have bit 30 set. Otherwise, the messages produced do not have this bit set. By using the AttachThreadInput function, a thread can attach its input processing to another thread. This allows a thread to call SetFocus to set the keyboard focus to a window attached to another thread’s message queue.

Читайте также:  Windows удалить файлы linux

How to return the ‘Open command window here’ option to Windows 10’s context menu

On Windows 10, Microsoft continues to fade out Command Prompt in favor of PowerShell. Although you can still use the console, you’ll notice that the option is no longer available on the Power User menu (Windows key + X), on the File menu for File Explorer, or in the extended context menu (Shift + Right-click).

While there is an option in the Settings app to add Command Prompt to the Power User menu, you won’t find an option to bring it back to the extended context menu. However, it’s still possible to re-incorporate the option in Windows 10, if you’re comfortable modifying the Registry.

In this Windows 10 guide, we walk you through the steps to bring back the «Open command window here» option to the context menu.

How to add ‘Open command window here’ to the context menu

Adding the «Open command window here» to the extended-folder context menu is a two-step process. First, you need to bring back the option when you open the menu when right-clicking a folder, and second, using similar steps, you need to return the option when right-clicking the background of a folder.

Adding ‘Open command window here’ to the folder context menu

In order to re-incorporate the option to launch Command Prompt on the extended context menu, you’ll need to modify the Registry using the following steps:

Warning: This is a friendly reminder that editing the registry is risky, and it can cause irreversible damage to your installation if you don’t do it correctly. We recommend making a full backup of your PC before proceeding.

If you’re ready, follow these steps:

  1. Use the Windows key + R keyboard shortcut to open the Run command.
  2. Type regedit, and click OK to open the Registry.

Browse the following path:

Right-click the cmd (folder) key, and click Permissions.

Click the Advanced button.

On «Advanced Security Settings,» click the Change link next to «Owner.»

Type your account name in the provided field, click Check Names to verify you’re typing the account name correctly, and click OK.

Check the Replace owner on subcontainers and objects option.

Under «Permissions for Administrators,» select Allow for the Full Control option.

Change the DWORD name from HideBasedOnVelocityId to ShowBasedOnVelocityId, and press Enter.

Once you complete these steps, using the Shift + Right-click combo on a folder will display the «Open command window here» option.

At any time, you can revert the changes following the same instructions, but on step No. 16, make sure to rename the DWORD from from ShowBasedOnVelocityId to HideBasedOnVelocityId, and press Enter.

Adding ‘Open command window here’ to the background context menu

The instructions mentioned above add the option to open Command Prompt on the folder context menu, but not when you Shift + right-click the background of the folder that is currently open.

If you want to Shift + right-click a background to open the location using Command Prompt, you need to follow these extra steps:

  1. Use the Windows key + R keyboard shortcut to open the Run command.
  2. Type regedit, and click OK to open the Registry.

Browse the following path:

Right-click the cmd (folder) key, and click Permissions.

Click the Advanced button.

On «Advanced Security Settings,» click the Change link next to «Owner.»

Type your account name in the provided field, click Check Names to verify you’re typing the account name correctly, and click OK.

Check the Replace owner on subcontainers and objects option.

Under «Permissions for Administrators,» select Allow for the Full Control option.

Change the DWORD name from HideBasedOnVelocityId to ShowBasedOnVelocityId, and press Enter.

Once you complete these steps, when using the Shift + right-click combo on a folder background you will see the «Open command window here» option.

You can revert the changes following the same instructions, but on step No. 16, make sure to rename the DWORD from from ShowBasedOnVelocityId to HideBasedOnVelocityId, and press Enter.

How to remove ‘Open PowerShell window here’ from the context menu

You’ll also notice that using the above steps will bring back the «Open command window here,» but it’ll keep the «Open PowerShell window here» too.

If you want to remove the PowerShell entry from the extended context menu, do the following:

  1. Use the Windows key + R keyboard shortcut to open the Run command.
  2. Type regedit, and click OK to open the Registry.

Browse the following path:

Right-click the PowerShell (folder) key, and click Permissions.

Click the Advanced button.

On «Advanced Security Settings,» click the Change link next to «Owner».

Type your account name in the provided field, click Check Names to verify you’re typing the account name correctly, and click OK.

Check the Replace owner on subcontainers and objects option.

Under «Permissions for Administrators,» select Allow for the Full Control option.

Change the DWORD name from ShowBasedOnVelocityId to HideBasedOnVelocityId, and press Enter.

After completing these steps, using Shift + Right-click will only show the «Open command window here» option.

To bring back the PowerShell option, follow the same instructions, but on step No. 16, make sure to rename the DWORD from HideBasedOnVelocityId to ShowBasedOnVelocityId, and press Enter.

Wrapping things up

While you can run the majority of the commands using PowerShell, a lot of people still prefer Command Prompt, and the context menu option provides a quick way to open the utility in a specific location without having to type a long command to navigate to a folder path. But now, thanks to a hidden option in the Registry, you can bring that experience back to Windows 10.

More Windows 10 resources

For more help articles, coverage, and answers to common questions about Windows 10, visit the following resources:

The Dell XPS 15 is our choice for best 15-inch laptop

For a lot of people, a 15-inch laptop is a perfect size that offers enough screen for multitasking, and in a lot of cases, some extra performance from powerful hardware. We’ve rounded up the best of the best at this size.

Halo: MCC’s live service elements make it better, not worse

Halo: The Master Chief Collection is more popular than ever, but some fans don’t agree with the live service approach 343 Industries has taken with it. Here’s why those elements are, at the end of the day, great for the game and for Halo overall.

Microsoft’s Surface Duo is not ‘failing up’

Microsoft announced this week that it was expanding Surface Duo availability to nine new commercial markets. While Surface Duo is undoubtedly a work in progress, this is not a sign of a disaster. It’s also doesn’t mean that Surface Duo is selling a ton either. Instead, the reason for the expansion is a lot more straightforward.

These are the best PC sticks when you’re on the move

Instant computer — just add a screen. That’s the general idea behind the ultra-portable PC, but it can be hard to know which one you want. Relax, we have you covered!

Читайте также:  Показать строки файла linux
Оцените статью