Sometimes you will need to copy the results of certain commands to the clipboard, with this often being done in two steps. First you will need to output these to a text file (example: ipconfig /all > c:\config.txt) and then to open this file so that you can copy the contents onto the Windows clipboard.
With Windows 2003 server, there is a new utility called clip.exe that allows you to direct the results of a command directly to your clipboard. This means you will no longer have to perform the intermediary step (of copying the results form a text file).
Here is how it can be done:
First of all, if you are using Windows XP then you will need to download the clip.exe file and copy it to the %systemroot%\system32 directory.
Once the file has been downloaded and copied we will look at an example of this application.
Open the Command box and input the command that you want redirected to the clipboard. For example, listing the contents of the C drive with the following command:
dir c: | clip
As you would have noticed, nothing will actually be displayed on the screen if the command has been correctly executed. The results of the command will actually be redirected to the clipboard and you will need to start the clipbrd application to see the results (Start, Run and type clipbrd. Then click on OK). Here are the results:
Of course this final step is not necessary as you can simply “paste” the clipboards contents where ever you like.