Robotic Process Automation (RPA)

 View Only
Expand all | Collapse all

Get Value from Windows CMD window

  • 1.  Get Value from Windows CMD window

    Posted Wed October 11, 2023 09:29 AM

    Hi,

    We are trying to automate CMD based application, but when trying to get value(text) from CMD there is an error: 

    the script we are trying:
    defVar --name w1 --type Window
    defVar --name text --type String
    openFile --file "cmd.exe"
    delay --timeout "00:00:05.0100000"
    findWindow --title "C:\\Windows\\System32\\cmd.exe" --safesearch  w1=value
    attachWindow --window ${w1}
    getValue --selector "TypeAndName" --name "Text Area" --controltype "TextBox" text=value
    messageBox --title test --text "${text}" --icon "Information" --buttons "OK" --defaultbutton "FirstButton"



    ------------------------------
    Michał Adamski
    ------------------------------


  • 2.  RE: Get Value from Windows CMD window

    IBM Champion
    Posted Fri October 13, 2023 05:13 PM

    Hi!

    If it is a simple output, maybe you can get away with using shortcuts to copy the text since Get Value isn't working.

    If it is a terminal application, you might want to check the Terminal commands, since there is a specific category for them. I haven't used them yet, but from what I can tell, this would be used when running terminal applications from another server. If this is the case and your application is local, one idea that might be worth exploring is SSHing into the localhost, just so you can use these terminal commands since they seem more varied than just attaching to the window and using getValue.

    But if you just want to run a command and the application allows it (through parameters, for example), then you might be able to get away with running Powershell or Bash commands and capturing the output (could be sending them to the clipboard and retrieving from there).



    ------------------------------
    Vinicius Marques
    ------------------------------