How to read multiple commands from excel file and run it in cygwin (similar to command prompt)

Hi,

i have to build a bot to read commands from excel file and Run them in Cygwin (similar to CMD prompt). can anyone help on this,

thank you,

HI @rajthyaga53

Can you please tell us more info about your task?

What type of commands? Some screenshots ?

Regards
Sudharsan

@rajthyaga53

Read the data in to datatable using read range

Now use a for each row in datatable to loop through each command

Then use start process to start the cngwin and pass the arguments as the currentrow(columnname).tostring

This will invoke each command

Cheers

commands contains server details, i have to check server status for different servers

i think i can’t share that information

Hi @rajthyaga53

  1. Read Range: Read the commands from the Excel file.
  2. For Each: Iterate through the rows of the DataTable.
  3. Get Row Item: Get the command from the current row.
  4. Execute Command: Run the command in Cygwin.
  5. Write Line: Write the output of the command to the log or to a file (optional).

Hi thank you , it worked till executing commnads, but how to extract output data and store in excel file

Hy @rajthyaga53 ,

  1. Drag and drop the “Write Range” activity onto the canvas and select the Excel file that you want to write to.
  2. In the “Write Range” activity, specify the range of cells that you want to write to in the Excel sheet. You can also specify the data that you want to write, which can be a variable or a hard-coded value.
  3. Run the workflow. The “Write Range” activity will write the data to the specified cells in the Excel sheet.

what variable need to be given in datatable field
image

@rajthyaga53
You need to declare a new variable. Ctlr+K to add a new variable .

Where are the output data stored @rajthyaga53 ?

@rajthyaga53

Output datatable is empty…please check if it is given data or not.You can do so by running in debug mode and check locals panel…use some break points to pause to check if data is present

Cheers

thats where i am stuck, not able to store output data


this is the workflow i did, i think before write range i need to extract output and store it into variable , can you please tell me how to do that

@rajthyaga53

Where is your data?

If in webpage use extract datatable and store it

If in excel then use read range

cheers

iam getting the output in cygwin(similar to CMD prompt), how to extract it

@rajthyaga53

Try attaching to the cmd window and try to extract the data…or in your cmd …try to execute a save command and save the data to excel then read it from there

cheers