Dear Mr.entropyreduction,
Thank you so much! I took your good advice and made the script save the
value to an ini file. I didn't realize it was a DWORD; I must have
messed up the value in my own registry somewhere along the lines because
it was indeed a Binary in my registry. But I have them disabled anyways
so I can used custom hotkeys.
My original aim was this: Since we live at a religious house (I am a
Catholic religious brother) we are not allowed to have internet access
at our work-desks and so we all use a common computer room if we need to
do any work online. I have set up my USB disk as a portable office,
using PP as my all-powerful launcher. Problem is, on some of the
internet computers, the winkeys are turned on and I can't use the same
hotkeys there as I do on my desk computer, so I thought I would turn
them off with powerpro when I begin my session and then reset them when
I leave. But your mentioning that I need to logoff and on to get the
effect has put a damper in my plan!
Nevertheless, with your assistance, I have reconstructed my function and
it works now. Thank you very much!
;Toggle Current User's Windows Hotkeys on or off
function Winkeys(how)
local RTI = scriptfolder++"/RegTweak.ini"
local ExplorerKey =
?"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\"
local NoWinKeysKey = ExplorerKey++"NoWinKeys\\"
If (how == 0) or (how == "")do ;;DISABLE
reg.set_dword(ExplorerKey,"NoWinKeys","00000001")
ElseIf (how ==1)do ;;ENABLE
reg.set_dword(ExplorerKey,"NoWinKeys","00000000")
ElseIf (how==2)do ;;Capture current registry value
local REGvalue = reg.get_dword(ExplorerKey,"NoWinKeys");;value
currently in registry
ini.set(RTI, "OriginalSettings", "NoWinkeys", REGvalue)
ElseIf (how==3)do ;;Return Original Value
local INIvalue = ini.get(RTI, "OriginalSettings",
"NoWinkeys");;value stored in the ini file
reg.set_dword(ExplorerKey,"NoWinKeys",INIvalue)
EndIf
reg.unload
quit