Jump to content

receive command line output

Recommended Posts

What I would like to do is capture output from a command line program.

in bash it would be

msg=$(command opts)

I know this has been discussed before in this forum, but maybe there is an update.

I was thinking about writing to a file command > tmp.txt.

Or I could set an enviroment variable, but I am not sure how to pipe into set

and it would be easier to read the file in autoit than redirect the input.

There was a listing about reading output in a beta version, but I am afraid

of that going to all my workstations.

Any thoughts?

Edited by blakel
Link to post
Share on other sites

Thank you for the reply.

That is the topic I read, but for this purpose, I do not want to use beta.

I have found a way to pipe into set using the for command.

Here is an example for the ipaddress, which I know is a macro.

for /F "tokens=15" %%T IN ('ipconfig /all ^| find /i ^"ip address^"') DO set IPADDRESS1=%%T

also note that this does not deal with multiple ip addresses.

If you have any thing better, let me know.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...