Jump to content
Sign in to follow this  

StdoutRead does not work when using @ComSpec

Recommended Posts

I am attempting to use the Windows XP utility schtasks.exe to list all scheduled tasks on a computer. I want to use the StdoutRead to get this info into my script without having to send the data to a CSV file then look through it later. The only way I have been able to get the schtasks.exe to work through Autoit is using

run(@ComSpec & " /k schtasks.exe /query /fo csv /nh /v", @TempDir)

I think the problem that the StdoutRead is having is that it's trying to read the output from the @ComSpec instead of the schtasks.exe. Is there any way to fix this?



hmm... I guess I have to have a signature...

Share this post

Link to post
Share on other sites

Is there any way to fix this?

Too little to go on, Brother.

I don't know whether to take the posted function call above as actually from your script, but I do note that there's no fourth parameter to tell Run that you want to capture STDOUT.

The /k switch to @COMSPEC tells it to keep the console running after the program that you're calling exits; when you use it it seems like the command shell doesn't output anything to STDOUT until the console window is closed. Probably not desired, so I'd use /c instead or just call the program directly in Run...

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...