>>98
VSCode の拡張機能のおすすめは、Code Runner で、
右クリックメニューから、選択したコード、またはファイル全体を実行する

この設定をチェックしておく
Code-runner: File Directory As Cwd
Whether to use the directory of the file to be executed as the working directory.

そうすると実行時にcd で、そのファイルがある場所へ、カレントディレクトリを移動してから、
例えばRuby なら、ruby "絶対パス/ファイル名.rb"
又は、ruby "絶対パス/tempCodeRunnerFile.rb"
で、そのファイルを実行する

tempCodeRunnerFile.rb は、Rubyのコード片をコピーした、一時的なファイル

設定項目、executorMap には、多くの言語の実行コマンドが書いてある。
"code-runner.executorMap": {

"javascript": "node",

"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",

"python": "python -u",
"ruby": "ruby",

あとは、VSCodeのスレで聞いて