Jump to content

How to run piped DOS programs


Recommended Posts

G'day everyone

I'm trying to let AutoIt execute three programs in a DOS console. I can't seem to figure out the syntax for it, though.

Basically, there are three programs called cut.exe, diff.exe and grep.exe, all in the same folder. I also have files named WSpel.txt and ClipB.txt in that same folder. Without AutoIt, I would use a DOS window and type the following:

diff.exe WSpel.txt ClipB.txt | grep.exe ">" | cut.exe -d" " -f2 > Typos.txt

This would produce a file called Typos.txt with some content in it.

I'd like AutoIt to execute that line for me, in the background, as fast as possible (so opening a DOS window and using "Send" is the last resort here). I was hoping to use Run or RunWait, but it doesn't seem to execute the line. I've tried the following two options, neither of which works:

RunWait ("C:\Kastrool\diff.exe WSpel.txt ClipB.txt | grep.exe "">"" | cut.exe -d"" "" -f2 > Typos.txt", "", @SW_HIDE)

RunWait(@ComSpec & " /c " & "C:\Kastrool\diff.exe WSpel.txt ClipB.txt | grep.exe "">"" | cut.exe -d"" "" -f2 > Typos.txt", "", @SW_HIDE)

Can anyone tell me what the correct syntax is?

Thanks!

Link to comment
Share on other sites

I'd like AutoIt to execute that line for me, in the background, as fast as possible (so opening a DOS window and using "Send" is the last resort here).

Actually, I have in the past used "Send". What I did was to create a batch file named a.bat and put the DOS stuff in it, and then just send A and ENTER. Can I do it faster and better, though?

Link to comment
Share on other sites

look up the run function in the beta help. the help file is located here most likely.

c:\program Files\AutoIt3\beta\AutoIt.chm

in there is the standard_i/o_flag. in my Send/Check Email using SSL/TLS; POP3 & SMTP project i use the beta run to do it. look at my V2 code.

Good Luck!

Link to comment
Share on other sites

I'm trying to let AutoIt execute three programs in a DOS console.

Thanks for everyone helping out (I've used MHz's syntax eventually). Not that this is likely to be useful, but in the spirit of sharing scripts, here is the completed script for which I wanted to know the original question. Besides the script, you'll also need a spelling dictionary in plaintext (one word per line) called WSpel.txt and the three UnxUtils tools mentioned. The UnxUtils web site is http://unxutils.sourceforge.net/.

The script is uploaded. The UnxUtils isn't uploaded because I don't have their sources to upload as well.

kastrool1.au3

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...