Redirection in Shell()

In either the cmd console or a batch file, the following sends the executable file’s output to the clipboard.

<path>\foo.exe | clip

If I run this in Shell(), the executable file runs, but nothing is sent to the clipboard.

The following also doesn’t send the output to the clipboard.

Shell("cmd.exe /C ""<path>\foo.exe | clip""", 2,,True)

Edit: The above was originally typed from memory & left out some quote marks. I’ve corrected it. Also, <path> & foo are obviously stand ins for the actual path & file name.

I tried hitting the computer with a rock, but that didn’t help

Before I resign myself to using a batch file, does anyone know of a way to redirect output in Shell?

Looks like we have a xy-problem

please, please explain: WHAT exactly does this magic »foo.exe« and also WHAT is your plan to do with the clipboard then!!

:thinking:
image

I typed from memory. That should be

Shell("cmd.exe /C ""<path\foo | clip""", 2,,True)