If you use the command prompt quite often and have to copy and paste output from the commands in the command prompt then this tip should be of great help to you. Copy and paste from Windows Command prompt (DOS Window) can be a real pain and one would agree it doesn’t have to be.

In Windows Vista, Windows 7, Windows Server 2003 and later,You can direct the output from a command from command prompt directly to the Windows clipboard using the windows clip.exe utility. All you need to do is to run the command you want to copy the output and pipe “|” the output to the clip utility which copies the output to the Windows clipboard.

This should work on Windows XP, but you may need to copy the clip.exe from either Windows 2003 or Windows Vista PC onto the Windows XP PC (to c:\windows\system32)

For instance, here I run the ipconfig command and direct its output to the clipboard.

C:\Users\sai>ipconfig /all | clip

This should copy the output to the the clipboard. To confirm, it indeed has been copied, simply select paste from any application like notepad, wordpad or Ms Word and you should see the output of the ipconfig /all command.

Windows IP Configuration

Host Name . . . . . . . . . . . . : ANNAI

Primary Dns Suffix  . . . . . . . :

Node Type . . . . . . . . . . . . : Hybrid

IP Routing Enabled. . . . . . . . : No

WINS Proxy Enabled. . . . . . . . : No

Connection-specific DNS Suffix  . :

Description . . . . . . . . . . . : Marvell Yukon 88E8040 PCI-E Fast Ethernet Controller

Physical Address. . . . . . . . . : 00-11-00-11-77-74

DHCP Enabled. . . . . . . . . . . : Yes

Autoconfiguration Enabled . . . . : Yes

IPv4 Address. . . . . . . . . . . : 192.168.0.5(Preferred)

Subnet Mask . . . . . . . . . . . : 255.255.255.0

Lease Obtained. . . . . . . . . . : 20 March 2009 06:26:07

Lease Expires . . . . . . . . . . : 23 March 2009 06:26:06

Default Gateway . . . . . . . . . : 192.168.0.1

DHCP Server . . . . . . . . . . . : 192.168.0.1

DNS Servers . . . . . . . . . . . : 192.168.0.1

NetBIOS over Tcpip. . . . . . . . : Enabled

### 2 Responses to “Copy Command prompt output directly Clipboard in Windows”

1. Very nifty hint, but I can’t get it to work on XP. I tried copying from Server 2003 (32 bit) to an XP SP3 machine, but it gives the error “clip.exe is not a valid Windows32 application”. It works fine on the Server 2003 machine.

2. That doesnt work in windows xp but you have a switch that which helps you to copy and paste the same.

“For instance, here I run the ipconfig command and direct its output to the clipboard.

C:\Users\sai>ipconfig /all | clip”

In this place what we can do in Winxp is

Microsoft Windows XP [Version 5.1.2600]