Sunflat のブログ

ソフトウェア開発についての話題が多いかも

Windows 8 で簡単シャットダウン

Windows 8をシャットダウンするのが面倒臭いので、ショートカットを作った。

以下のファイルを"confirm-shutdown.js"等の名前で作成し

var sh = new ActiveXObject("WScript.Shell");
if (sh.Popup("Are you sure you want to shutdown?",0, "Confirmation", 1+32) == 1) {
    sh.Exec("shutdown -s -t 0")
}

"wscript.exe [confirm-shutdown.jsのパス]"という内容のショートカットを作っておく。起動すると、シャットダウンを確認するダイアログが出る

おまけ1

こっちのほうがいいかも?(試してない)
http://crystaldew.info/2012/07/16/windows-8-sleep-shortcut/

おまけ2

Windows8アプリを出したよ
http://www.sunflat.net/windows/