从电子应用程序打开Windows日期时间设置

时间:2018-02-14 09:02:20

标签: node.js windows electron

我们制作了一个电子应用程序,用户将一些文件添加到我们的S3存储桶中。如果日期&计算机的时间不正确,S3上传失败。我们想告诉用户如何解决问题。是否可以从节点启动Windows日期时间设置,以便我们可以使最终用户更容易?

2 个答案:

答案 0 :(得分:1)

在Windows 10中,您可能希望显示新的Windows设置应用。您可以opening the correct URL完成此操作。

enter image description here

因此,要打开日期/时间设置,您将使用以下代码:

const { shell } = require('electron')
shell.openExternal('ms-settings:dateandtime');

答案 1 :(得分:0)

require('child_process').spawn('control', ['timedate.cpl'])