windows_unlocker.py 744 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. '''
  4. @Contact : liuyuqi.gov@msn.cn
  5. @Time : 2022/10/05 05:44:28
  6. @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
  7. @Desc : 登录界面自动化输入密码,权限有问题,弃用
  8. '''
  9. from ctypes import *
  10. import time
  11. # while True:
  12. # u = windll.LoadLibrary('user32.dll')
  13. # result = u.GetForegroundWindow()
  14. # print(result) # 0则表示锁屏
  15. # time.sleep(2)
  16. import pyautogui
  17. pyautogui.FAILSAFE=False
  18. time.sleep(5)
  19. pyautogui.press('enter') # enter to login.
  20. #pyautogui.click(1025,513, 2) # click to show the password box
  21. time.sleep(1)
  22. pyautogui.typewrite("Asdfghjkl;'",2) # Type the password
  23. pyautogui.press('enter') # enter to login.
  24. time.sleep(2)