Save Text from Command Prompt: 3 Ways to Do It

Learn how to save cmd output as text file

by Ivan Jenic
Ivan Jenic
Ivan Jenic
Troubleshooting Expert
Passionate about all elements related to Windows and combined with his innate curiosity, Ivan has delved deep into understanding this operating system, with a specialization in drivers and... read more
Affiliate Disclosure
  • Users who regularly who the Command Prompt to perform action may often need to save the output to a text file.
  • It helps keep track of the data and, in some cases, streamline the process.
  • There are three ways you can save command prompt output, which includes a quick shortcut.
learn how to save command prompt as text file

Command Prompt is one of the most important features of Microsoft’s Windows operating system. Users can basically perform any action on their computers with this tool, from checking data to solving various problems and even customizing the Command Prompt.

If you use this tool regularly, you’d probably want to save some often-performed commands, so you don’t have to type them repeatedly. Well, that’s possible in Windows 10’s Command Prompt, and there are even a couple of ways to do so.

In this article, we’re going to show you how to save any Command Prompt command as a text, so you can easily use it whenever you want.

How do I save text from Command Prompt in Windows 10?

1. Create an executable command

  1. Open Notepad.
  2. Write a command in Notepad (In our case, that’ll be sfc/scannow, but you can use any other).
  3. Go to File, click on Save, select All files from the dropdown menu, and then save it as .bat file with wherever name you text command prompt

The most effective way to run a command over and over again is to create an executable of that command. To do that, you need to write a command in Notepad, save it as .bat, and execute it.

You can now open the .bat file you’ve just saved, and it will perform the same command each time. You need to open it as Administrator. Do check how you can always run a file as administrator.

2. Select all and copy

  1. Execute the desired command in the CMD.
  2. Right-click in the Command Prompt, and choose Select all
  3. Press Ctrl + C to copy the content.
  4. Now, paste it into a text editor, preferably Notepad.

Creating a .bat file is the most effective way of performing the same command multiple times. However, a lot of commands are there to show you some data, like your ping status or hard drive info. So, if you want current results from a command, you cannot perform it repeatedly.

In that case, you’ll want to save data from the Command Prompt into a text file.

3. Use the clip command

  1. Execute any command in CMD and wait for the result to appear.
  2. Now, type it again, followed by this command, and hit Enter:|clipclip command
  3. Now, the output is copied to the clipboard. Use Ctrl + V to paste it.

There’s another way to copy results from a command in the Command Prompt that some users will find even easier. That’s a simple Command Prompt command called clip that allows you to copy everything from a window to the clipboard.

That’s about it! As you can see, copying text from the Command Prompt is quite easy and requires minimal effort.

And do find out how to open a folder in Command Prompt, before you leave.

If you have any comments or questions, just let us know in the section below.

This article covers:Topics: