0

Remap winKey + <anyKey> while still having it be possible to lock computer

1 Answers1

0

I set the lock shortcut to ctrl + F12 (you can change it to whatever you like).

AutohotkeyV1 script: (Run as administrator)

#InstallKeybdHook

; Disable win + l key locking (This line must come before any hotkey assignments in the .ahk file)

RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 1

;CTRL + F12 to lock computer ^F12:: ; Renable locking RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 0 ; Lock the computer DllCall("LockWorkStation") ;after locking workstation force a reload of this script which effectively disables Win + L locking the computer again Reload

Credit