Monday, September 21, 2020

Setting VS Code to Edit Windows Batch Files

You will need to edit the Windows Registry to make this update so tread lightly.
  1. Launch the Registry Editor (regedit.exe)
  2. Navigate to the following branch: HKEY_CLASSES_ROOT\batfile\shell\edit\command
  3. Double-click the (default) value on the right. By default, VS Code is installed under C:\users\{YourUserName}\AppData\Local\Programs\Microsoft VS Code and the executable file is Code.exe. You will need to find the path to VS Code executable.
  4. Replace the existing data with the complete path of VS Code that you discovered in step 3. In my case it was: "C:\Users\{YourUserName}\AppData\Local\Programs\Microsoft VS Code\Code.exe" "%1"
  5. Note that in step 4 above to include the "%1"
  6. Exit the Registry Editor.

 

No comments: