Direct Output to Text File from Command Prompt

By vbb|2009 January 18|tags: , ,

Sometimes you may need to copy contents from a command prompt window. Doing this is simple and I have already posted posted about it.

However problem may arise if you want to copy a large chunk of text from command prompt.For example if you want to get list of all files under system32 directory of Windows ,the above trick will be a pain to apply.In this kind of situation it’s good to direct the output of command prompt window to a text file.

Syntax for Direct Output to text file from Command Prompt

Just putĀ  a “Greater Than sign” (>)after the command and write the name of the text file.For Example if you want to get file listing under system32 directory just write

dir >desired_file_name.txt

The following figure shows how a text file is created with completeĀ  listing of system32 directory.

command-prompt-output-to-notepad

command-prompt-output-to-notepad

The text file ‘new.txt’ is located in D drive,as a path is also provided in the command.If you don’t provide the path,the text file will be created in the same directory from where you are issuing the command.

Related posts:

  1. Copy ,Paste from and to Command Prompt
  2. How to Extract Text from Images for Free!
  3. Unknown File Extension -Open with what?
  4. Batch File for Scheduling Automatic Connection to BSNL Broadband for Night Downloads
  5. What is a DAA file? How to Open a DAA file?

Enter your email address and subscribe for FREE updates

Or Get Full Updates through RSS Feed

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS