首页 > 解决方案 > 运行 powershell 命令在电子中不起作用

问题描述

所以我有一个可以运行power shell命令的脚本,主要问题是当我与其他人共享它时它不起作用但是当我在我的电脑上运行它时它确实起作用。

 fs.mkdirSync(response.filePaths[0] + "\\Workroom");
    fs.writeFileSync(response.filePaths[0] + "\\Workroom\\bot.js", "");
    fs.mkdirSync(response.filePaths[0] + "\\Workroom\\node_modules");
    require('winax');
    var run=new ActiveXObject('WSCRIPT.Shell').Run("npm install --prefix "+response.filePaths[0]+"\\Workroom"+" discord.js", 0);
    fs.writeFileSync("./path.txt", response.filePaths[0]);

标签: javascriptelectron

解决方案


推荐阅读