Skip to content

Instantly share code, notes, and snippets.

@hihigash
Created May 29, 2018 02:30
Show Gist options
  • Select an option

  • Save hihigash/9682bd42e42a80ca5aa7b3acb9dd8d52 to your computer and use it in GitHub Desktop.

Select an option

Save hihigash/9682bd42e42a80ca5aa7b3acb9dd8d52 to your computer and use it in GitHub Desktop.
Hide "Open in Visual Studio" from shell context menu
@ECHO OFF
SETLOCAL
SET BACKGROUNDSHELL=HKCR\Directory\Background\shell\AnyCode
REG QUERY %BACKGROUNDSHELL%
IF %ERRORLEVEL% == 0 CALL :ADD_EXTENDED %BACKGROUNDSHELL%
SET SHELL=HKCR\Directory\shell\AnyCode
REG QUERY %SHELL%
IF %ERRORLEVEL% == 0 CALL :ADD_EXTENDED %SHELL%
GOTO END
:ADD_EXTENDED
REG ADD %1 /v Extended /t REG_SZ
GOTO :EOF
:END
ENDLOCAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment