Skip to content

Instantly share code, notes, and snippets.

@en0ndev
Last active May 3, 2026 01:45
Show Gist options
  • Select an option

  • Save en0ndev/0e70e5f07296fbfe3dd9628cd19615da to your computer and use it in GitHub Desktop.

Select an option

Save en0ndev/0e70e5f07296fbfe3dd9628cd19615da to your computer and use it in GitHub Desktop.
REMOVE "OPEN IN VISUAL STUDIO" IN THE CONTEXT MENU

How to Remove "Open in Visual Studio" in the Context Menu

Also you can watch the video.
https://www.youtube.com/watch?v=8S7s-p_enSY


STEP 1

  • Press Win+S keys, and search regedit then open Regedit (Registry Editor).

STEP 2

# Go to path of HKEY_CLASSES_ROOT\Directory\Background\shell

STEP 3

# Remove AnyCode key.

STEP 4

# Go to path of HKEY_CLASSES_ROOT\Directory\shell\

STEP 5

# Remove AnyCode key.

It currently deleted from the context menu.

@galvesco
Copy link
Copy Markdown

God bless you. Thank you it worked perfectly

@idbttp
Copy link
Copy Markdown

idbttp commented Nov 4, 2023

Always works like a charm, thanks!

@thewerthon
Copy link
Copy Markdown

Isn't there an option during installation that disables the feature by default?
Registry modification works, but the feature returns when updating Visual Studio.

@JoaoAfonsoP
Copy link
Copy Markdown

Thank you for the tip. Dealing with such issues has always been frustrating in Windows.

@DeadlyVirez
Copy link
Copy Markdown

Thank you so much!

@yhd4711499
Copy link
Copy Markdown

Thanks

@Laicure
Copy link
Copy Markdown

Laicure commented Oct 8, 2024

very straightforward, thanks!

@Zommer2108
Copy link
Copy Markdown

You are the best! Thank you this is amazing.

@hungtrieu07
Copy link
Copy Markdown

Thanks for your sharing.

@SriHari-15
Copy link
Copy Markdown

Thank you for the info!

@shadowlocked
Copy link
Copy Markdown

Thank you!!

@PetrKnedlik
Copy link
Copy Markdown

Thank you 🖤

@Romkieff
Copy link
Copy Markdown

Thank you very much !

@Nedrozak
Copy link
Copy Markdown

Nedrozak commented Mar 7, 2025

Amazing!

@idbrii
Copy link
Copy Markdown

idbrii commented Mar 17, 2025

You could also run batch commands to script this (especially if you frequently setup new machines):

reg copy "HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode" "HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode_Disabled" /s
reg copy "HKEY_CLASSES_ROOT\Directory\shell\AnyCode" "HKEY_CLASSES_ROOT\Directory\shell\AnyCode_Disabled" /s

reg delete "HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode" /f
reg delete "HKEY_CLASSES_ROOT\Directory\shell\AnyCode" /f

This renames the key to AnyCode_Disabled in case you need it back. If you don't want that, then just use the delete commands.

You have to run these commands in an Admin shell.

@heide-oficial
Copy link
Copy Markdown

Thanks

@HugoCortell
Copy link
Copy Markdown

Most excellent

@robertgro
Copy link
Copy Markdown

Thank you very much

@tronghieu906
Copy link
Copy Markdown

Thanks bro

@spmoya
Copy link
Copy Markdown

spmoya commented Jan 15, 2026

Thanks! Always works like a charm <3

@silverweed
Copy link
Copy Markdown

🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment