2

I have 4 commands chained together and I want to copy the output of all four of them to the clipboard at once (basically append the clipboard with the output of each). Is this possible. The command I am running is this.

ipconfig | findstr "IPv4" & systeminfo | findstr /B /C:"OS Name" /C:"OS      Name" & wmic cpu get caption & wmic diskdrive get model & wmic diskdrive get size 
Jasonca1
  • 4,848
  • 6
  • 25
  • 42

1 Answers1

3

I think you would do it like this:

(command1 & command2 & command3 ) | clip
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • Confirmed this works by doing a simple test: `(echo 1 & echo 2) | clip` –  Nov 30 '16 at 16:40
  • Thank you very much Mark. This is exactly what I wanted. – Jasonca1 Nov 30 '16 at 17:36
  • @Jasonca1 If you put parentheses around, it hasn't to be a one liner. Multiple lines are easier to read/maintain. –  Nov 30 '16 at 18:31
  • 1
    Nice solution, although it's problematic with the commands of the question, since all of them produce ASCII/ANSI output, except for `wmic`, which returns Unicode text, which all becomes mixed up; see also [this answer](https://stackoverflow.com/a/25604222/5047996) or [this one](https://stackoverflow.com/a/50985724)... – aschipfl Mar 20 '19 at 21:31