|
|
@ -311,16 +311,32 @@ def SystemCMDRun(inSessionHexStr, inCMDCommandStr = "echo 1", inModeStr="CROSSCH
|
|
|
|
while lRecoveryWindowRUNRetryIteratorInt<gRecoveryWindowRUNRetryCountInt: # loop for retry
|
|
|
|
while lRecoveryWindowRUNRetryIteratorInt<gRecoveryWindowRUNRetryCountInt: # loop for retry
|
|
|
|
lCMDPostFixStr = "" # Case default "RUN"
|
|
|
|
lCMDPostFixStr = "" # Case default "RUN"
|
|
|
|
if inModeStr == "CROSSCHECK":
|
|
|
|
if inModeStr == "CROSSCHECK":
|
|
|
|
lCMDPostFixStr = f"& (echo {lCrosscheckKeyStr} | clip)"
|
|
|
|
#lCMDPostFixStr = f"& (echo {lCrosscheckKeyStr} | clip)"
|
|
|
|
|
|
|
|
lCMDPostFixStr = f"| (echo {lCrosscheckKeyStr} | clip)" # Bugfix async set clipboard data
|
|
|
|
elif inModeStr == "LISTEN":
|
|
|
|
elif inModeStr == "LISTEN":
|
|
|
|
lCMDPostFixStr = f"| clip"
|
|
|
|
lCMDPostFixStr = f"| clip"
|
|
|
|
|
|
|
|
Clipboard.TextSet("") # Clear the clipboard
|
|
|
|
KeyboardHotkey("win","r") # win+r
|
|
|
|
KeyboardHotkey("win","r") # win+r
|
|
|
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all
|
|
|
|
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all Bugfix - need double ctrl A because some OS reset selestion when ctrl A in RUN window
|
|
|
|
|
|
|
|
#time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
keyboard.send("backspace") # Delete selected 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...
|
|
|
|
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
|
|
|
|
lInputStr = f"cmd /c ({inCMDCommandStr}) {lCMDPostFixStr}" # Generate the output string for RUN window
|
|
|
|
keyboard.write(lInputStr) # Write new text
|
|
|
|
keyboard.write(lInputStr) # Write new text
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
|
|
|
|
# Check if autocomplete
|
|
|
|
|
|
|
|
# # # # # # #
|
|
|
|
|
|
|
|
KeyboardHotkey("ctrl", "c") # Copy data
|
|
|
|
|
|
|
|
# Check the clipboard
|
|
|
|
|
|
|
|
lClipboardStr = Clipboard.TextGet() # Get text from clipboard
|
|
|
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
|
|
|
|
#lL.debug(f"Clipboard text when check autocomplete:'{lClipboardStr}'")
|
|
|
|
|
|
|
|
if lClipboardStr != "": # Send backspace if
|
|
|
|
|
|
|
|
time.sleep(gKeyboardHotkeyDelaySecFloat)
|
|
|
|
|
|
|
|
keyboard.send("backspace") # Delete selected all
|
|
|
|
|
|
|
|
# # # # # # # #
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all
|
|
|
|
KeyboardHotkey("ctrl","a") # Select all
|
|
|
|
KeyboardHotkey("ctrl","c") # Copy data
|
|
|
|
KeyboardHotkey("ctrl","c") # Copy data
|
|
|
|
# Check the clipboard
|
|
|
|
# Check the clipboard
|
|
|
|