Jump to content

Clipboard utility to interface with AU3

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)

    $sExeListName = "c:\exelist.txt"
    RunWait(@comspec & " /c dir *.EXE /s/b>" & $sExeListName,"",@SW_HIDE)
    $sExeList = FileRead($sExeListName, FileGetSize($sExeListName))

    RunWait(@comspec & " /c dir *.EXE /s/b|cb.exe","",@SW_HIDE)
    $sExeList = ClipGet()

Have fun :D

Link to post
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 post
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 post
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:


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


-  A console app to use in a %comspec% session to pipe info

into the clipboard or into an "Environment Variable".


-  redirect to clipboard

....<stdout> | DirectTo.exe /c

-  redirect to Environment Variable and run App

....<stdout> | DirectTo.exe /e "VariableName" "File String To Run"


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"))


MsgBox(4096,"","Click OK to run DirectTo.exe test")


RunWait(@COMSPEC & ' /c DIR | DirectTo.exe /e OUTPUT "' &

@ScriptFullPath & ' test"',"",@SW_HIDE)


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")


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...