Skip to content

Instantly share code, notes, and snippets.

@aaronchiang
Created January 14, 2016 01:05
Show Gist options
  • Save aaronchiang/68817c5b467220cd793b to your computer and use it in GitHub Desktop.
Save aaronchiang/68817c5b467220cd793b to your computer and use it in GitHub Desktop.
OpenWithVSCode on Windows
@echo off
SET codePath=C:\Program Files (x86)\Microsoft VS Code\code.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with VS Code" /t REG_SZ /v "" /d "Open with VS Code" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with VS Code" /t REG_EXPAND_SZ /v "Icon" /d "%codePath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command" /t REG_SZ /v "" /d "%codePath% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with VS Code" /t REG_SZ /v "" /d "Open with VS Code" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with VS Code" /t REG_EXPAND_SZ /v "Icon" /d "%codePath%,0" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with VS Code\command" /t REG_SZ /v "" /d "%codePath% \"%%1\"" /f
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment