我们正在使用 npm-regedit 模块在 Windows 中读取/写入注册表。我们在 Electron 应用程序中使用它。通常,当我们运行应用程序时,它工作正常,但是当我们将应用程序设置为在启动时自动运行时,regedit 模块会失败。我们在读取“HKCU/SOFTWARE”时收到以下错误:
错误:命令失败:cscript.exe//Nologo D:\CodeLathe\Workspace\cl-fc-client\clouddrive2service\ui\dist_ Electron\win-unpacked\resources\app.asar\vbs\regList.wsf A HKCU\软件
最佳答案
将regedit包中的VBS文件夹(存放.wsf文件的目录)复制到自己的目录中。
然后自定义VBS目录:regedit.setExternalVBSLocation('./common/vbs');
关于npm - 错误: Command failed: cscript. exe//无标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59302554/