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

Win10 右鍵選單新增「關閉 Windows 10」選項:VBS 腳本 + 登錄檔實現一鍵關機

編輯:Windows 10 系統介紹

Windows 10 關機需點擊「開始 → 電源 → 關機」三步驟,較為繁瑣。透過撰寫簡單 VBS 腳本呼叫 Shell.Application.ShutdownWindows 方法,並透過登錄檔加入桌面/檔案總管右鍵選單,即可實現右鍵一鍵呼出關機對話方塊,大幅提升效率。

實作步驟

1. 建立關機 VBS 腳本

  1. 開啟記事本,貼入以下程式碼:
dim objshell
set objshell = CreateObject("shell.application")
objshell.ShutdownWindows
set objshell = nothing
  1. 另存為 shutdown.vbs(編碼 ANSI,副檔名 .vbs)。
  2. 將檔案移動至 C:\Windows\ 目錄(需管理員權限,點擊「繼續」)。

2. 建立右鍵選單登錄檔

  1. 開啟記事本,貼入以下內容:
Windows Registry Editor Version 5.00

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

[HKEY_CLASSES_ROOT\Directory\Background\shell\SuperHidden\Command]
@="WScript.exe C:\\Windows\\shutdown.vbs"
  1. 另存為 regshutdown.reg(副檔名 .reg)。
  2. 雙擊執行 →「是」→「確定」匯入登錄檔。

右鍵選單效果預覽

關機對話方塊

使用方式

桌面或檔案總管空白處右鍵 → 選擇 「關閉 Windows 10」 → 彈出標準關機對話方塊 → 選擇關機/重新開機/睡眠/休眠。

移除方式

開啟 regedit,刪除機碼 HKEY_CLASSES_ROOT\Directory\Background\shell\SuperHidden,並刪除 C:\Windows\shutdown.vbs。

補充:其他實用右鍵選單擴充

  • 「在這裡開啟 PowerShell」:HKEY_CLASSES_ROOT\Directory\Background\shell\OpenPowerShellHere
  • 「以系統管理員身分開啟命令提示字元」:類似方式註冊 cmd.exe /k cd %V
  • 推薦工具:Right Click Enhancer、Context Menu Tuner 圖形化管理右鍵選單。
Copyright © Windows教程網 All Rights Reserved