When the above command is executed, the output will be saved to "output.txt" in the "logs" directory in my documents folder (because that was where I opened the command window from).Īnother way to achieve this, is rather than opening the command window from the directory you're saving the text file to, you can just specify the entire path. Then in the command prompt window, type the following command: I do this by holding down SHIFT + right mouse button and clicking "Open command window here" as you can see in the picture below: What I tend to do is first open Windows explorer and navigate to a folder where I'd like to save the text file and open then the command prompt from there. So for example, say you want to save the output of the net start command to a file called "output.txt", then all you have to do is the following:įirst, we need to open a command prompt window. The redirection command involves the use of the greater than ">" symbol to direct the output of your command to a file with a name of your choosing. You basically use the redirection command. This trick that I'm going to show you will enable you to save the entire output to a file. So what can you do? Well you could mark the text and copy it to the clipboard, but there's an easier way than that.
Sometimes however, the buffer may get full and you loose some of the output.
This is fine, but what if the command you executed spits out hundreds of lines?Īnd sometimes, there can be so much output that you have to scroll through it all to view it. When you type something into the Windows command prompt, the output stays in the Windows command prompt. When you purchase through links on our site, we may earn an affiliate commission.
Disclosure: Bonkers About Tech is supported by its readers.