leuce Posted March 7, 2006 Share Posted March 7, 2006 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 More sharing options...
Valuater Posted March 7, 2006 Share Posted March 7, 2006 i dont have the exact answer.. but you can check the "out come" of you line with a messgae box $String = "C:\Kastrool\diff.exe WSpel.txt ClipB.txt | C:\Kastrool\grep.exe "">"" | C:\Kastrool\cut.exe -d"" "" -f2 > Typos.txt" MsgBox(0,"", $String) 8) Link to comment Share on other sites More sharing options...
leuce Posted March 7, 2006 Author Share Posted March 7, 2006 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 More sharing options...
MHz Posted March 7, 2006 Share Posted March 7, 2006 Try this: RunWait(@ComSpec & ' /c C:\Kastrool\diff.exe WSpel.txt ClipB.txt | grep.exe ">" | cut.exe -d" " -f2 > Typos.txt', 'C:\Kastrool', @SW_HIDE) Link to comment Share on other sites More sharing options...
mikeytown2 Posted March 7, 2006 Share Posted March 7, 2006 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! Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
leuce Posted March 7, 2006 Author Share Posted March 7, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now