コマンドの実行 - Node.js

  • 作成日:
  • 最終更新日:2025/06/25

Node.js から Powershell コマンドを実行する

以下のコマンドは、新規ファイルを Node.js のスクリプト上からコマンドを実行して作成します。

let pro = require('child_process');
pro.exec('type nul > test.txt');