CMD Command promt

Hi, How can we read the data from the cmd command promt and write into it.

Thank you

@anudeep_k,

Use screen scraping methods to read data from CMD.

1 Like

maybe something like this can help you out.

Main.xaml (6.4 KB)

Thanks for your suggestion, I used it but i am getting all the content on the on the command promt I need only a specific line to be read, is there any possibility for that.

Thanks for your suggestion, I used it but i am getting all the content on the on the cmd I need only a specific line to be read, is there any possibility for that.

@anudeep_k,

After getting data, apply string manipulation methods to retrieve required line.

1 Like

Thank you.

do you have any document regarding string manipulation.

@anudeep_k,

Could you please share that text the one you are reading it from CMD and then tell which line you want to read it.

If it is confidential then share some sample text or send me personally.

Hi @anudeep_k,

Welcome to the Community. :smiley:

First split the string by lines by referring below post.

How to split a variable value with respect to each each line? RPA Dev Advanced

Try: yourText.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries). Hope it works!

Then you can fetch the specific value by index.

1 Like

Check if you can execute those commands via powershell , if yes you can use Invoke powershell , and get its output. you would just need to check the IsScript box , this ways your command would be executed as is without parsing.

1 Like

Thank you for you support

2 Likes

Thank you for you suggestion

1 Like

Thank you

1 Like