How to remove directory context menu added by Visual Studio 2017?

31,844

Solution 1

Run regedit.exe, go to HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode, take ownership of this key, change the permisions for your account and add a DWORD (32Bit) with the name HideBasedOnVelocityId and set the value to 006698a6 (hex):

enter image description here

When you now do a rightclick the entry is gone:

enter image description here

Delete entry or rename it to ShowBasedOnVelocityId to enable the entry again:

enter image description here

Solution 2

This answer is originally from here, and I am just reproducing it here for sake of brevity.

Use the Windows Registry editor to delete two keys:

HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode
HKEY_CLASSES_ROOT\Directory\shell\AnyCode

You may want to back up your registries before going for a delete operation, just a good practice.

Solution 3

From Bryson Gibbons on the Microsoft Forums:


Another option, if you don't want to just delete it or can see it being sometimes useful but don't want it cluttering up the context menu, is to move it to the extended context menu (where it is only visible with Shift+Right-click).

Using the Windows Registry editor, add a new string value under each of the following keys, with the name "Extended":

HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode
HKEY_CLASSES_ROOT\Directory\shell\AnyCode

You should then see the following contents when either of the above registry keys are selected:

Name        Type     Data
(Default)   REG_SZ   @C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\1033\\VSLauncherUI.dll,-1002
Extended    REG_SZ

After doing this you will only see "Open in Visual Studio" on folders/directories when you hold down shift, then right click.

Solution 4

You can use ShellMenuView to find this context menu entry and disable it.

  1. Download the program for your OS (32 or 64 bit) and run the shmnview.exe executable.
  2. Find in the list something that has to do with Visual Basics and seems to be this entry. (You can sort the list by File Type and look on the entries under with file type Directory)
  3. Right-click that entry and select Disable Selected Items.

Solution 5

Based on the answer by @Blaze:

Instead of searching for keys with the registry editor, just copy this into an empty file with a .reg file extension and execute that file to delete the keys.

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode]
[-HKEY_CLASSES_ROOT\Directory\shell\AnyCode]
Share:
31,844

Related videos on Youtube

aniskhan001
Author by

aniskhan001

Working with: Go, Docker, Kubernetes, Prometheus, EFK, etc.

Updated on September 18, 2022

Comments

  • aniskhan001
    aniskhan001 over 1 year

    I have installed Visual Studio Community 2017 RC on Windows 10.
    After installing, it added a new context menu when right clicked on any directory.

    Visual Studio 2017 RC context menu

    I want to remove this option, but can't seem to find it from VS2017 settings.

    • Mike Gledhill
      Mike Gledhill over 6 years
      This is one of the dumbest things Microsoft has ever added to the context menu. Seriously, I right-click on my Desktop image, and it wants to know if I want to open this in Visual Studio. Open what ?!! Do they think I want to debug my .png image file or something ?
    • magicandre1981
      magicandre1981 over 6 years
      @MikeGledhill linux programs don't have a solution file (sln) like Windows, so this option is to open linux solutions via VS2017
    • Stevoisiak
      Stevoisiak almost 6 years
  • magicandre1981
    magicandre1981 about 7 years
    this is a comment, but no real answer. Show more details how to remove the entry.
  • magicandre1981
    magicandre1981 about 7 years
    I explained now in detail how to remove it and not such a crap answer: superuser.com/a/1178368/174557
  • Yisroel Tech
    Yisroel Tech about 7 years
    @magicandre1981, I added the details on how to do it. (of course, your answer might still be better, depends on the user who asked it.)
  • aniskhan001
    aniskhan001 about 7 years
    I tried this software before posting the question. But I was unable to find the right entry from there and came here to ask the community. Thanks for your effort, though.
  • superjos
    superjos over 6 years
    you might want to fix typo 'Backgroud' -> 'Background'
  • magicandre1981
    magicandre1981 over 6 years
    @superjos done, next time click on edit and fix it yourself.
  • superjos
    superjos over 6 years
    I'm aware but not possible in this case: my account here on superuser has not enough reputation to apply 1-char edits to posts.
  • magicandre1981
    magicandre1981 over 6 years
    @superjos ok, I forgot this
  • dgo
    dgo about 6 years
    Thank you. Unfortunately the answer @magicandre1981 provided wasn't enough for me. I had to do as you suggested and delete. Then it worked.
  • kccricket
    kccricket about 6 years
    How does this solution differ from deleting the registry keys? Does it prevent Visual Studio from recreating the item in the future?
  • magicandre1981
    magicandre1981 about 6 years
    @kccricket it is easier to restore in case you want it back
  • Little Helper
    Little Helper almost 6 years
    I installed VS2017 in English language, but decided to install Russian language pack just in case. The context menu item somehow ended up being in Russian. Ridiculous.
  • Andreas
    Andreas over 5 years
    Another option: Simple export the branch HKEY_CLASSES_ROOT\Directory\shell\AnyCode and delete the key. If you want it back, import the reg file.
  • magicandre1981
    magicandre1981 over 5 years
    @mrt users later tend to delete the file and now it is gone. so rename is safest way.
  • Hugo Zink
    Hugo Zink over 5 years
    The image displays a different value for the registry key than the comment, and neither one of them worked.
  • mavis
    mavis over 5 years
    Thanks, @Blaze. Good that you brief them here. The link is broken now.
  • Naser.Sadeghi
    Naser.Sadeghi almost 5 years
    Is there a way to change the language of that context menu directory?
  • Naser.Sadeghi
    Naser.Sadeghi almost 5 years
    I found it. just need to modify the key value to refer to the folder containing my intended language.
  • JkAlombro
    JkAlombro almost 5 years
    Deleting these worked for me as well.
  • Aemony
    Aemony almost 4 years
    This was the case for me as well, although with the minor difference of it being located in HKEY_CLASSES_ROOT\Local Settings\MuiCache\304\52C64B7E, and the value was "Open in &Visual Studio"
  • Shrirang
    Shrirang over 3 years
    Like this answer. It is more customizable and helpful. Thanks @Stevoisiak!
  • aderchox
    aderchox about 3 years
    Thanks, this worked for me too. For anyone who might be worried, this will NOT affect VSCODE's item in the context menu.
  • Svante
    Svante almost 3 years
    This answer worked for me - I was able to very easily find the items I wanted to remove and disable them using the ShellMenuView software. Much easier than fiddling around in the registry!
  • Basil Peace
    Basil Peace over 2 years
    ShellMenuView runs under admin, which may be not the current user. And it looks that it can't enumerate user entries (HKEY_CURRENT_USER\SOFTWARE\Classes) at all. These may be the reasons why it doesn't show something
  • Basil Peace
    Basil Peace over 2 years
    This removes just the MUI string, but not the actual menu item. It could work if 1) Explorer just ignores incomplete items 2) MUI cache is not repopulated (after, for example, software or Windows update). Since MUI is used, you should search the value you found (@C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\1055\\VSLauncherUI.dll,-1002) in the usual places (proposed in other answers).