萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 伺服器教學

WinXP 任務列開啟程式出現雙重相同標籤?VBS 腳本一鍵修復註冊表

WinXP 任務列出現詭異現象:無論開啟什麼程式,任務列都顯示兩個完全相同的標籤(上下重疊)。這是註冊表中 Explorer 相關機損壞導致。提供一支 VBS 腳本,自動修復相關機碼並重啟 Explorer,四步驟解決。

修復腳本內容

新建記事本,貼入以下完整代碼,存檔為 fix_taskbar_double.vbs:

Set WSHShell = WScript.CreateObject("WScript.Shell")
Message = "本腳本用於修復 Windows XP 中當最小化程式時,無法在任務列顯示圖示的問題。" & vbCR & vbCR
Message = Message & "為了正常工作,本腳本將關閉和重啟 Windows Explorer 殼層,這個操作不會損壞你的系統。" & vbCR & vbCR
Message = Message & "請關閉所有防毒軟體的即時監控!並儲存所有開啟的文件。" & vbCR & vbCR
Message = Message & "是否繼續?"
X = MsgBox(Message, vbYesNo+vbExclamation, "注意")
If X = 6 Then
    On Error Resume Next
    WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2"
    WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\MRU"
    WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop"
    WshShell.RegDelete "HKCU\Software\Microsoft\Internet Explorer\Explorer Bars\{32683183-48a0-441b-a342-7c2a440a9478}\BarSize"
    P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
    WshShell.RegWrite P1 & "\NoBandCustomize", 0, "REG_DWORD"
    WshShell.RegWrite P1 & "\NoMovingBands", 0, "REG_DWORD"
    WshShell.RegWrite P1 & "\NoCloseDragDropBands", 0, "REG_DWORD"
    WshShell.RegWrite P1 & "\NoSetTaskbar", 0, "REG_DWORD"
    WshShell.RegWrite P1 & "\NoToolbarsOnTaskbar", 0, "REG_DWORD"
    WshShell.RegWrite P1 & "\NoSaveSettings", 0, "REG_DWORD"
    WshShell.RegWrite P1 & "\NoToolbarsOnTaskbar", 0, "REG_DWORD"
    WshShell.RegWrite P1 & "\NoSetTaskbar", 0, "REG_DWORD"
    WshShell.RegWrite P1 & "\NoActiveDesktop", 0, "REG_DWORD"
    WshShell.RegWrite P1 & "\ClassicShell", 0, "REG_DWORD"
    P1 = "HKCU\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\LocalUser\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
    WshShell.RegWrite P1 & "\NoCloseDragDropBands", 0, "REG_DWORD"
    WshShell.RegDelete P1 & "\NoMovingBands"
    P1 = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell"
    WshShell.RegWrite P1, "explorer.exe", "REG_SZ"
    P1 = "HKCU\Software\Microsoft\Internet Explorer\Explorer Bars\{32683183-48a0-441b-a342-7c2a440a9478}"
    WshShell.RegDelete P1 & "\BarSize"
    WshShell.RegWrite P1, "媒體區", "REG_SZ"
    On Error Goto 0
    For Each Process in GetObject("winmgmts:").ExecQuery("select * from Win32_Process where name='explorer.exe'")
        Process.Terminate(0)
    Next
    MsgBox "完成!" & vbcr & vbcr & "© Kelly Theriot and Doug Knox", 4096, "完成"
Else
    MsgBox "沒有對你的系統進行任何改變。" & vbcr & vbcr & "© Kelly Theriot and Doug Knox", 4096, "使用者取消"
End If

執行方式

  1. 關閉所有防毒軟體即時掃描,儲存開啟的檔案。
  2. 雙擊執行 fix_taskbar_double.vbs。
  3. 彈出確認視窗點選「是」,腳本自動修改註冊表並重啟 Explorer。
  4. 完成提示後,任務列恢復正常,不再出現重複標籤。

原理說明

腳本刪除損壞的 StuckRects2、Streams 等 Explorer 佈局快取機碼,重設任務列鎖定/自訂相關策略值,並確保 Winlogon\Shell 指向 explorer.exe,最後強制重啟 Explorer 套用變更。此腳本源自 Microsoft MVP Kelly Theriot 與 Doug Knox 的經典修復方案。

copyright © 萬盛學電腦網 all rights reserved