Skip to content

Instantly share code, notes, and snippets.

@triacontane
Created April 12, 2018 18:47
Show Gist options
  • Select an option

  • Save triacontane/a9f71b2b403478363ffd82e3e5c1822c to your computer and use it in GitHub Desktop.

Select an option

Save triacontane/a9f71b2b403478363ffd82e3e5c1822c to your computer and use it in GitHub Desktop.
画面をロックするスクリプトです。
if (Utils.isNwjs() && process.platform === 'win32') {
var exec = require('child_process').exec;
exec('rundll32.exe user32.dll,LockWorkStation');
}
@triacontane
Copy link
Author

実行すると画面をロックします。パスワードを設定している場合は再入力する必要があります。
実行環境がWindowsである場合のみ動作します。ちなみになんの役にも立ちません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment