1. Computing
Tim Fisher

Save a Command's Results to a File

By October 28, 2013

Follow me on:

One of the coolest Command Prompt tricks is the use of something called a redirection operator.

Very simply, a redirection operator can be used to redirect the output of a command (what the command displays on the screen) to a file. In other words, whatever the command was going to spit out on screen, it instead saves to a file.

If it hasn't dawned on you already, using a redirection operator can be extremely useful when running certain kinds of commands like ping, dir, systeminfo, and others that display tons of information that would be great to save and reference later.

Here's a really simple example:

ping 192.168.1.1 > c:\pingresults.txt

Using the > redirection operator saves the results of pinging 192.168.1.1 (which happens to be my router) to the pingresults.txt file, located in the root directory of my hard drive.

With the results of the ping command now saved to a file, I can email or post that file anywhere I want, providing really detailed information to someone helping me with my home networking problem. This works the same in Windows 8, Windows 7, Windows Vista, and Windows XP.

If you need some more help or want to see some more examples, check out How To Redirect Command Output to a File.

Connect With Tim: Google+ | Twitter | Facebook
Comments
No comments yet. Leave a Comment
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.