trids Posted June 4, 2004 Share Posted June 4, 2004 Here's a cool little utility (cb.exe) to route output from a commandline app straight to the clipboard .. which can then be interrogated from within AU3 (thereby avoiding the need to bounce the info through a file);BOUNCING RESULTS THROUGH A FILE $sExeListName = "c:\exelist.txt" RunWait(@comspec & " /c dir *.EXE /s/b>" & $sExeListName,"",@SW_HIDE) $sExeList = FileRead($sExeListName, FileGetSize($sExeListName)) FileDelete($sExeListName) ;CLEVERLY USING CB.EXE INSTEAD RunWait(@comspec & " /c dir *.EXE /s/b|cb.exe","",@SW_HIDE) $sExeList = ClipGet()Have fun Link to comment Share on other sites More sharing options...
SlimShady Posted June 4, 2004 Share Posted June 4, 2004 Nice. Very nice. Link to comment Share on other sites More sharing options...
kalayaan Posted June 4, 2004 Share Posted June 4, 2004 this'll come in handy. Link to comment Share on other sites More sharing options...
bobheart Posted June 4, 2004 Share Posted June 4, 2004 How would you write the ClipGet to a txt file ? Link to comment Share on other sites More sharing options...
Guest rathore Posted June 4, 2004 Share Posted June 4, 2004 How would you write the ClipGet to a txt file ?to output to text file:dir c:\windows > c:\dirlist.txtto append:dir c:\windows >> c:\dirlist.txt Link to comment Share on other sites More sharing options...
Chris_1013 Posted June 4, 2004 Share Posted June 4, 2004 What does this do that DirectTo.exe doesn't? Link to comment Share on other sites More sharing options...
trids Posted June 4, 2004 Author Share Posted June 4, 2004 What does this do that DirectTo.exe doesn't?Dunno till I see DirectTo.exe .. What / where is DirectTo.exe? Even Google doesn't appear to have heard of it. Care to share a link? Link to comment Share on other sites More sharing options...
Chris_1013 Posted June 4, 2004 Share Posted June 4, 2004 Ummm, best I can do you is a cut-n-paste of the e-mail Larry sent to the Yahoo Group a while back: http://groups.yahoo.com/group/AutoItList/f...IL/DirectTo.zip I have created a utility to direct %comspec% derived information into the clipboard OR an Environment Variable that can be retrieved through a subsequently run script... here is the readme text... DirectTo.exe - A console app to use in a %comspec% session to pipe info into the clipboard or into an "Environment Variable". Usage - redirect to clipboard ....<stdout> | DirectTo.exe /c - redirect to Environment Variable and run App ....<stdout> | DirectTo.exe /e "VariableName" "File String To Run" Examples Dir | DirectTo.exe /c Dir | DirectTo.exe /e OUTPUT "MyExe.exe MyArgument" AutoIt Usage (Compiled AutoIt3) If $CmdLine[0] = 1 Then MsgBox(4096,"I got the Output",EnvGet("OUTPUT")) Else MsgBox(4096,"","Click OK to run DirectTo.exe test") ;WORD WRAP CRAPPED RunWait(@COMSPEC & ' /c DIR | DirectTo.exe /e OUTPUT "' & @ScriptFullPath & ' test"',"",@SW_HIDE) EndIf essentially the RunWait runs this... (on my PC) cmd.exe /c DIR | DirectTo.exe /e OUTPUT "c:\DirectToTest.exe test" which populates the environment var "OUTPUT" with the dir listing and reruns my script so that I can play with EnvGet("OUTPUT") Larry Link to comment Share on other sites More sharing options...
trids Posted June 4, 2004 Author Share Posted June 4, 2004 Thanks Chris - and thanks Larry Now we have two to choose from! 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