Created
February 22, 2023 09:06
-
-
Save akordowski/66259496d265cb9607746c9106073392 to your computer and use it in GitHub Desktop.
Add "Open with VSCode" to Windows Explorer Context Menu (including folders)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clear-Host | |
$PATH = "C:\Users\<USERNAME>\AppData\Local\Programs\Microsoft VS Code\Code.exe" | |
Write-Host "Add for all file types" -ForegroundColor Green | |
REG ADD "HKEY_CLASSES_ROOT\*\shell\VSCode" /ve /t REG_EXPAND_SZ /d "Open with Code" /f | |
REG ADD "HKEY_CLASSES_ROOT\*\shell\VSCode" /v "Icon" /t REG_EXPAND_SZ /d "$PATH" /f | |
REG ADD "HKEY_CLASSES_ROOT\*\shell\VSCode\command" /ve /t REG_EXPAND_SZ /d """$PATH"" ""%1""" /f | |
Write-Host "Add for directories" -ForegroundColor Green | |
REG ADD "HKEY_CLASSES_ROOT\Directory\shell\VSCode" /ve /t REG_EXPAND_SZ /d "Open with Code" /f | |
REG ADD "HKEY_CLASSES_ROOT\Directory\shell\VSCode" /v "Icon" /t REG_EXPAND_SZ /d "$PATH" /f | |
REG ADD "HKEY_CLASSES_ROOT\Directory\shell\VSCode\command" /ve /t REG_EXPAND_SZ /d """$PATH"" ""%V""" /f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment