Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows 8 右鍵選單新增「關機」選項:VBS 腳本 + 登錄檔一鍵部署

編輯:Win8 系統應用技巧

Windows 8 關機步驟繁瑣,本文教您透過一段 VBS 腳本與登錄檔,在資源管理器或桌面空白處右鍵即可直接呼叫系統關機對話方塊,並包含「切換使用者」、「登出」等額外選項,比原生關機更方便。

部署步驟

1. 建立關機腳本 (shutdown.vbs)

dim objshell
set objshell = CreateObject("shell.application")
objshell.ShutdownWindows
Set objShell = nothing

將上述程式碼貼上記事本,存為 shutdown.vbs。

編輯關機腳本

2. 建立登錄檔 (reg.reg)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\SuperHidden]
@="關閉 Windows 8"

[HKEY_CLASSES_ROOT\Directory\Background\shell\SuperHidden\Command]
@="WScript.exe C:\\Windows\\shutdown.vbs"

存為 reg.reg。

3. 部署並執行

  1. 將 shutdown.vbs 移至 C:\Windows\ 目錄。
  2. 雙擊執行 reg.reg,確認匯入登錄檔。
  3. 完成後,在資源管理器或桌面空白處右鍵,即可看到「關閉 Windows 8」選項。

登錄檔匯入成功

右鍵選單效果

電腦常識

效果比較

  • 原生 Modern 關機:睡眠、關機、重新啟動。
  • 右鍵版關機:上述三項 + 切換使用者、登出。

移除方法

執行 reg delete "HKCR\Directory\Background\shell\SuperHidden" /f 並刪除 C:\Windows\shutdown.vbs 即可還原。

Copyright © Windows教程網 All Rights Reserved