🐍 Python 3.10+
Disable Lock Screen (Python)
Skips straight to the sign-in screen instead of showing the lock screen (requires admin). Requires an elevated (Administrator) prompt. Applies the tweak via the stdlib winreg module.
set_disable_lock_screen.py
#!/usr/bin/env python3
"""
set_disable_lock_screen.py
Disable Lock Screen.
Skips straight to the sign-in screen instead of showing the lock screen (requires admin). Requires an elevated (Administrator) prompt.
Usage:
python set_disable_lock_screen.py
"""
import winreg
def main() -> None:
key = winreg.CreateKeyEx(
winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Policies\Microsoft\Windows\Personalization", 0, winreg.KEY_SET_VALUE
)
winreg.SetValueEx(key, "NoLockScreen", 0, winreg.REG_DWORD, 1)
winreg.CloseKey(key)
print("Disable Lock Screen applied.")
if __name__ == "__main__":
main()