MS-DOS Commands :: clip

Overview:

The clip command copies all output from a command to the Windows Clipboard. You can then paste the Clipboard contents into to any Windows application, such as into Windows Notepad or Microsoft Word, typically by pressing Ctrl-V (or selecting menu item Edit > Paste) in that program.

Tip: dir | clip copies the directory listing that is output from the dir command to the Windows Cliboard.

clip.exe Availability:

Do I have clip.exe?

The clip.exe command file comes standard with Windows Vista and newer versions of Windows. It does not come standard with earlier versions of Windows such as Windows XP. (clip.exe first appeared in the Windows 98 Resource pack, and then reappeared starting with Windows Vista).

To see if you have clip.exe on your computer, type clip /? and if it is not available, you will see an error: 'clip' is not recognized as an internal or external command, operable program or batch file.

Can I get it from one of my other computers?

If you do not have it, you may be able to get a copy of it from one of your other computers; just copy the clip.exe file from that other computer's %windir%\system32 folder to your own %windir%\system32 folder. Note: Copying clip.exe from a newer version of Windows to an older version of Windows will not work.

I can't get it anywhere. Now what?

Joel 'Jaykul' Bennett (HuddledMasses.org) is a C# programmer who wrote his own custom clip program (see clip.cs C# source code) that provides equivlaent functionality as the Windows clip.exe program.

WARNING: This custom clip program is intended to be used only with ASCII text files.

Follow these steps to install a clip.exe command program:

  1. Download clip.zip and unzip it to get clip.exe
    (Note: This is not the Microsoft version)

  2. Put clip.exe in %windir%\system32 directory (typically C:\Windows\system32) or in any other directory that is in your path.

Note: If you want to see the source code and create the .exe yourself (using the Microsoft Visual C# compiler of .NET Framework 3.5), see: clip-paste.zip

Command Variations:

command | clip

Copies the output from the specified command command to the Windows clipboard.

clip < filename

Copies the contents of the filename file to the Windows Clipboard.

clip /?

CLIP

Description:
    Redirects output of command line tools to the Windows clipboard.
    This text output can then be pasted into other programs.

Parameter List:
    /?                  Displays this help message.

Examples:
    DIR | CLIP          Places a copy of the current directory
                        listing into the Windows clipboard.

    CLIP < README.TXT   Places a copy of the text from readme.txt
                        on to the Windows clipboard.

(Enlarge: clip /?)

Related Commands:

paste
Paste the contents of the Windows Clipboard to command input.