Disable Windows 7 hotkeys

This little script disables Windows 7 hotkeys if you have no local admin rights and registry editor (regedit) is also disabled.  Simply save it as hkey.vbs and execute.

Option Explicit
'Declare variables
Dim WSHShell, rr, MyBox, val, ttl
Dim jobfunc, itemtype
On Error Resume Next
Set WSHShell = WScript.CreateObject("WScript.Shell")
val = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\DisabledHotkeys"
itemtype = "REG_EXPAND_SZ"
ttl = "Result"
jobfunc = "Value: "
'write the registry key value.
WSHShell.RegWrite val, "1234567890", itemtype
rr = WSHShell.RegRead(val)
MyBox = MsgBox(jobfunc & rr, 4096, ttl)

This example disabled WIN+0 – WIN+9 keys. To disable other keys simply modify second RegWrite parameter.
For more technical info on windows hotkey codes see http://www.geoffchappell.com/notes/windows/shell/explorer/globalhotkeys.htm

Leave a Reply

Your email address will not be published. Required fields are marked *