Python脚本:1Remote_RDP_Autoreconnection (#1536)

基于1Remote软件的Rdp本地远程日志监控,并自动检测断连重启的Python脚本。需要看readme才能使用!!
This commit is contained in:
火山
2025-08-10 16:25:01 +08:00
committed by GitHub
parent 1dc0c910c7
commit 939a96cf48
3 changed files with 481 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import pyautogui
import time
print("正在执行会话关闭后操作...")
time.sleep(2)
# 返回Windows桌面Win+D
pyautogui.hotkey('winleft', 'd') # 更通用的Win+D组合键
time.sleep(1) # 等待1秒
# 按下Alt+M键半秒后松开
pyautogui.keyDown('alt') # 按住Alt键
pyautogui.press('m') # 按M键
time.sleep(0.5) # 精确等待0.5秒(半秒)
pyautogui.keyUp('alt') # 松开Alt键
pyautogui.keyUp('m') # 松开M键确保按键无粘连
time.sleep(0.1) # 等待0.1秒
# 按两次回车键间隔0.3秒
pyautogui.press('enter')
time.sleep(0.3) # 等待0.3秒
pyautogui.press('enter')
print("操作完成!")