Option Explicit On Error Resume Next Dim WSHShell, n, p, itemtype, MyBox, vbdefaultbutton Set WSHShell = WScript.CreateObject("WScript.Shell") p = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoWinKeys" itemtype = "REG_DWORD" n = WSHShell.RegRead (p) errnum = Err.Number if errnum <> 0 then WSHShell.RegWrite p, 1, itemtype End If If n = 0 Then WshShell.RegWrite p, 1, itemtype MyBox = MsgBox("WinKeys are now DISABLED", 64, "Disable WinKeys") End If If n = 1 Then WshShell.Regwrite p, 0, itemtype MyBox = MsgBox("WinKeys are now ENABLED", 64, "Enable WinKeys") End If Set WshShell = Nothing