Loading...
How-To'sWindows

How to Copy Command Output to Text file, Windows Clipboard

copy command output to text windows clipboard

Command prompt of Windows is still a very powerful tool to perform various tasks. There are certain things in Windows OS that can only be accomplished by running commands. For example, networking related activities, like Ping, tracert. And you know that the result of these commands is very useful. And if you ever wondered that if this result can be sent to a text file or clipboard, then don’t worry now. Today I will tell you two very easy methods to copy command output to text file. Also, I will tell you how you can directly send the command output to the Windows clipboard.

Copy command output to text file

It doesn’t require any third-party tool or software t copy command output to text file. There are some native tweaks in Windows that you can use to do the same. And the same tweaks I will explain in this guide shortly. In some cases, it is good to keep the output of a certain command to a file for research or as a backup. For example, you can record ping data for a certain hop and use it to study the behavior of packets later.

Copy Command Output to a Text file, Windows Clipboard:

Windows Command prompt uses some special characters to record the command output. And it is extremely simple to do that. You just have to add those characters at the end of the command to record the output. See the following sections for more details.

Method 1: Copy Command Output to a text file:

In this method, I will show you how to copy command output to text file. And to do this, you will not have to do so much labor. Just type the command in the command window whose output you want to copy. And add the “> filename.txt” text in the last of it. You can also use the desired file name. After doing this, the result of the command will get copied to a text file whose name you have typed in the command. The text file will be saved in the current working directory.

copy command output to text file

Method 2: Copy Command Output to Windows Clipboard:

You have seen how to copy command output to text file. And now I will show you how to do it for Windows clipboard. Adding “| clip” at the end of the command whose output you want to capture, will copy its output to the Windows clipboard. Later you can manually paste the clipboard text to anywhere you like.

copy command output to clipboard

So, this is how you can easily copy command output to text or clipboard using these two methods.

Wrap UP

If due to some reason, you wanted to capture the output of the command but weren’t able to do it. So, I have explained two easy methods to do that in a simple way. You can now record the output of any command in Windows command prompt.

Also See:

How to Setup Metered Connection in Windows 10 Creators Update?

How To Send Anonymous Email?