jakobve wrote:This is what gets output on CMD:
That doesn't make any sense to me. But anyway, if you want cmd.exe to execute a command, you need the /c or /k command-line switch (it isn't just preferred, but required).
If I change my keyboard language from Swedish to US English, it works, but only if I don't do anything in between starting cmd and sending the commands. If I try to move the CMD window and then send text, the text never gets sent.
It sounds like you are
not using the script you posted, but are sending the commands as keystrokes. In that case, the result you described would make a little more sense.
Guest wrote:No need to run the cmd.exe
There is a need. If used correctly, cmd.exe will interpret the pipe character as an instruction to take the output of the first command and pass it to the second command. Without cmd.exe, "| clip" would simply be passed as a parameter and have the wrong effect.
However, the purpose of piping the output to
clip is probably to get it into the script via the clipboard. In that case, I would suggest getting the output directly, such as by using the Shell.Exec() method shown in the RunWait documentation, or the StdoutToVar() function which can be found on the forums.