How to: Export a Command Prompt output to a file in Windows


Instructions

  1. Open the Command Prompt.

  2. Type your chosen command, the greater than symbol (>), and the name for the file that you wish to generate. Then, press Enter.

    EXAMPLE: ping www.ttu.edu>filename.txt

    Command Prompt window with a command entered to export the output to a text file.

Outcome

The results of the command are exported to a text file. If you ran the command as a user, the file will be in the root of your user profile folder. If the command was run as an administrator, it will be located in C:\Windows\System32.

File Explorer window showing the exported text file selected.

TIP: To control where the file is saved, you can alter the command to include the path on your computer where you wish to save the file.

EXAMPLE: ipconfig /all>c:\users\jdoe\desktop\ipconfig.txt

Command Prompt window showing a command with a full file path to save the output to the desktop.