I'm wondering how to copy a chunk of output in the command prompt in Windows 7. What I'm ultimately trying to accomplish is when I type "route print" I want to copy the IPs listed under IPv4 Route Table. I used the findstr command to grab 1 line at a time but is there a way to grab the whole table in one shot?
Thanks,
"grab" in what sense?
Would piping the output to a file be useful? e,g.
c:\route print > test.txt
You can copy the output directly into your windows clipboard by 'piping' to 'clip'
so your command would look like this:
You can then paste in notepad, etc.
You can also manually copy pieces to the clipboard by right-clicking the window, selecting 'mark' then dragging across an area. While the area is highlighted, the clipboard will contain a copy of that area.
Ok, this is getting pretty ugly but seems to work, somehow:
This yields the complete IPv4 routing table for me, excluding the interface list.
You may be better off running it through
for /f
, though and just count the number of lines that consist solely of=
signs to know where you are in the output.Try using powershell. You can do a lot more with that. There may be a better way to do it.
c:>route print > rprint.txt
c:>notepad rprint.txt