|
|
|
@ -21,6 +21,8 @@ gRecoveryWindowRUNRetryIntervalSecInt = 3 # Retry interval for retry
|
|
|
|
|
gRecoveryCMDResponsibleRetryCountInt = 3 # Retry iteration count is CMD is not responsible
|
|
|
|
|
gRecoveryCMDResponsibleRetryIntervalSecInt = 3 # Retry interval for retry
|
|
|
|
|
|
|
|
|
|
gKeyboardHotkeyDelaySecFloat = 0.6 # Const for delay - important for work with RDP!!!!
|
|
|
|
|
|
|
|
|
|
#Connect to RDP session
|
|
|
|
|
"""
|
|
|
|
|
{
|
|
|
|
@ -312,16 +314,15 @@ def SystemCMDRun(inSessionHexStr, inCMDCommandStr = "echo 1", inModeStr="CROSSCH
|
|
|
|
|
lCMDPostFixStr = f"& (echo {lCrosscheckKeyStr} | clip)"
|
|
|
|
|
elif inModeStr == "LISTEN":
|
|
|
|
|
lCMDPostFixStr = f"| clip"
|
|
|
|
|
keyboard.press_and_release('win+r')
|
|
|
|
|
time.sleep(1) # Wait for RUN window will appear
|
|
|
|
|
lRDPWindow.type_keys("^(a)") # Select all
|
|
|
|
|
keyboard.press_and_release("backspace") # Delete selected all
|
|
|
|
|
time.sleep(0.5) # Wait for RUN window will appear ctrl+a+backspace is async - so we need some timeout...
|
|
|
|
|
KeyboardHotkey("win","r") # win+r
|
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all
|
|
|
|
|
keyboard.send("backspace") # Delete selected all
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat) # Wait for RUN window will appear ctrl+a+backspace is async - so we need some timeout...
|
|
|
|
|
lInputStr = f"cmd /c ({inCMDCommandStr}) {lCMDPostFixStr}" # Generate the output string for RUN window
|
|
|
|
|
keyboard.write(lInputStr) # Write new text
|
|
|
|
|
time.sleep(0.5)
|
|
|
|
|
lRDPWindow.type_keys("^(a)") # Select all
|
|
|
|
|
lRDPWindow.type_keys("^(c)") # Copy data
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all
|
|
|
|
|
KeyboardHotkey("ctrl","c") # Copy data
|
|
|
|
|
# Check the clipboard
|
|
|
|
|
lClipboardWaitTimeStartSec = time.time()
|
|
|
|
|
lClipboardStr = Clipboard.TextGet() # Get text from clipboard
|
|
|
|
@ -393,3 +394,11 @@ def SystemRDPWarningClickOk():
|
|
|
|
|
{"title": "OK", "class_name": "Button"}]).click()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pass
|
|
|
|
|
# Bugfix with RDP work
|
|
|
|
|
def KeyboardHotkey(inModifierKeyStr,inKeyStr, inDelaySecFloat=gKeyboardHotkeyDelaySecFloat):
|
|
|
|
|
keyboard.press(inModifierKeyStr)
|
|
|
|
|
time.sleep(inDelaySecFloat)
|
|
|
|
|
keyboard.send(inKeyStr)
|
|
|
|
|
time.sleep(inDelaySecFloat)
|
|
|
|
|
keyboard.release(inModifierKeyStr)
|
|
|
|
|
time.sleep(inDelaySecFloat)
|