【发布时间】:2017-06-21 18:23:24
【问题描述】:
我正在尝试使用网络路径在 Electron 中运行批处理文件。我正在使用的功能是:
function cpSixHundred() {
require('child_process').exec("file:\\\\LSC-SA-NAS1\\Departments\\Information Technology\\Software\\Zebra Label Printer Reset Counters", function(err, stdout, stderr) {
if (err) {
// Ooops.
// console.log(stderr);
return console.log(err);
}
// Done.
console.log(stdout);
});
}
我得到的错误是:
Error: Command failed: \\LSC-SA-NAS1\Departments\Information
Technology\Software\Zebra Label Printer Reset Counterstest.bat
'\\LSC-SA-NAS1\Departments\Information' is not recognized as an internal or
external command,
operable program or batch file.
我知道它不喜欢网络路径中的空间。我尝试了许多引号和字符串连接的组合,但仍然没有运气。
提前谢谢你。
【问题讨论】:
-
这个问题看起来很相似。也许不是,但值得一看:stackoverflow.com/questions/16395612/…
标签: javascript electron