【问题标题】:runas xcopy crashing my Electron applicationrunas xcopy 使我的 Electron 应用程序崩溃
【发布时间】:2017-06-13 20:44:35
【问题描述】:

我正在尝试使用runas 和 xcopy 将 scr 文件复制到 c:\Windows\System32,但它使我的应用程序崩溃。我正在用 ClojureScript 编写代码,所以我的代码如下所示:

(runas "C:\\Windows\\System32\\xcopy.exe"
       #js ["C:\\Users\\pupeno\\Documents\\Dashman\\clients\\dist\\win-unpacked\\Dashman.scr"
            "C:\\Windows\\System32\\"
            "/F"]                                                                                    
       #js {:admin true})

编译为:

configurator.main.runas.call(null,
                             "C:\\Windows\\System32\\xcopy.exe",
                             ["C:\\Users\\pupeno\\Documents\\Dashman\\clients\\dist\\win-unpacked\\Dashman.scr",
                              "C:\\Windows\\System32\\",
                              "/F"],
                             ({"admin": true}));

当我运行此代码时,我被要求输入密码,但随后应用程序就冻结了。有什么想法可能有什么问题吗?

谢谢

【问题讨论】:

    标签: javascript electron clojurescript runas


    【解决方案1】:

    发现问题。 xcopy 提示覆盖权限,添加 /Y 属性解决了这个问题。

    此外,令人惊讶的是,无论是否将 catchOutput 设置为 true,我都无法从 xcopy 获得任何输出。

    【讨论】:

      猜你喜欢
      • 2020-02-05
      • 2020-04-13
      • 2011-05-26
      • 2013-08-20
      • 2021-08-28
      • 2012-05-09
      • 2010-11-08
      • 2014-01-24
      • 1970-01-01
      相关资源
      最近更新 更多