Remap winKey + <anyKey> while still having it be possible to lock computer
Asked
Active
Viewed 290 times
0
Sebastian Nielsen
- 405
- 5
- 18
1 Answers
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
Sebastian Nielsen
- 405
- 5
- 18