Sign in to follow this  
Followers 0
Dwight

Help with getting output from command line app

7 posts in this topic

Hi All,

Love AutoIT!!! It's really helped me in my XP upgrade rollout.

In one of my scripts I need to run the "devcon" app from the command line. I use this to query the system hw to see if a specific NIC adapter is present. If so, then I later update the driver for it using devcon again.

What I need to so is run this command:

devcon find * | find 'Broadcom' | find 'PCI'

...which generates this output...

PCI\VEN_14E4&DEV_167D&SUBSYS_05771014&REV_11\4&111A1FD8&0&00E0: Broadcom NetXtreme Gigabit Ethernet #2

I need to set a variable's value to that text output.

Running the devcon commands is not a problem. However, the "output" of running devcon via RunWait just returns 0 or 1, based on success or failure.

So what's the right way to capture this true output so I can either: a) immediately use it, or :D store it in a variable ??

Share this post


Link to post
Share on other sites



Might want to look into StdoutRead in the help file

Thanks... but I did a search in the Index and regular Search for "StdoutRead" with no results...

Searched for "out" also with nothing as you describe.

So what am I missing? Is it called something else?

Share this post


Link to post
Share on other sites

Might want to look into StdoutRead in the help file

OK, I see that I'm using the "public" version and in the beta version, there are additional commands you are both speaking of. OK, let me try these. Thanks!

Share this post


Link to post
Share on other sites

One last thing...

First, I got the StdOutRead to work...

However, I need to run this command:

$GetDevconID = Run("C:\Windows\XPupgrade\devcon find * | find "Broadcom" | find "PCI"", "", @SW_HIDE, 2)

Notice that my command line requires the " symbol. The ' symbol can not be used.

I can not seem to figure out how to get the " symbols to stay in my command line and have AutoIT interpret the command correctly. Hopefully I'm explaining this correctly.

Share this post


Link to post
Share on other sites

Change the out "s to 's See below....

$GetDevconID = Run('C:\Windows\XPupgrade\devcon find * | find "Broadcom" | find "PCI"', "", @SW_HIDE, 2)

Share this post


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
Sign in to follow this  
Followers 0