Skip to content

Instantly share code, notes, and snippets.

@sftblw
Last active September 7, 2018 14:44
Show Gist options
  • Select an option

  • Save sftblw/cf086f6e7e9475fe1eb9e0aa19cc0c63 to your computer and use it in GitHub Desktop.

Select an option

Save sftblw/cf086f6e7e9475fe1eb9e0aa19cc0c63 to your computer and use it in GitHub Desktop.
vscode code-runner cl.exe launch setting (Windows)
  • cmd.exe based, launches vcvarsall.bat first, clrscr, run, remove compiled binaries
  1. install code-runner addon for Visual Studio Code
  2. find your vcvarsall.bat (under VSdir/VC) and replace path of setting (path in the provided file is default path of VS2017)
  3. add this config to your config
  4. DO NOT LAUNCH FROM UNSAVED FILE. YOU CAN'T GIVE A INPUT TO THEM.
{
"code-runner.runInTerminal": true,
"terminal.integrated.shell.windows": "cmd.exe",
"code-runner.executorMap": {
"c": "cd $dir && \"C:\\\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" && cl.exe \"$fileName\" && cls && \"$fileNameWithoutExt.exe\" && del \"$fileNameWithoutExt.exe\" \"$fileNameWithoutExt.obj\"",
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment