我正在尝试在node.js中运行test.bat文件。
以下是代码:
var exec = require('child_process').execFile;
case '/start':
req.on('data', function (chunk) {});
req.on('end', function () {
console.log("INSIDE--------------------------------:");
exec('./uli.bat', function (err, data) {
console.log(err);
console.log(data);
res.end(data);
});
});
break;
运行此node.js文件时,我遇到了以下问题:
INSIDE--------------------------------:
{ [Error: Command failed: '.' is not recognized as an internal or ext
nd,
operable program or batch file.
] killed: false, code: 1, signal: null }
./
路径看起来非常像 Unix。 - salezica./
吗? - fiskeben