Jump to content

Clipboard utility to interface with AU3


trids
 Share

Recommended Posts

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 :D

Link to comment
Share on other sites

Guest rathore

How would you write the ClipGet  to a txt file ?

to output to text file:

dir c:\windows > c:\dirlist.txt

to append:

dir c:\windows >> c:\dirlist.txt

Link to comment
Share on other sites

What does this do that DirectTo.exe doesn't?

Dunno till I see DirectTo.exe :D .. 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

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

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...