Command prompt is command line interpreter and still used for many operations. For instance, you can use “DIR” command to print contents of windows directory or you can use “CHKDSK” command to check the Disk and get the status report or if you want to get the list of commands that you can use with command prompt then use ” HELP” command.

Now after executing the command you may need to copy the output to File or Clipboard to print it. You can do following WITHOUT even opening cmd prompt windows-

1. Execute the command.

2.Save the Output to File or Clipboard.

Steps to execute the command to output to File:

It is very simple. Open Windows Explorer and enter following command in Address bar-

cmd /c help > c:\tmp\help.txt

It will create output on C:\tmp folder by creating a file help.txt.  ‘cmd’ command will invoke the command prompt. ‘/c’ will close the command prompt after executing the command. ‘help’ command will provide the list of commands that can be run on command prompt. ‘>’ sends the output to file.

 

Similarly you can run command CHKDSK to get the disk status-

cmd /c chkdsk > c:\tmp\diskstatus.txt

Run DIR command to list details of the folder-

cmd /c dir > c:\tmp\dir.txt

Note: The above command will list out files and folders of default path which normally is system32. If you want to list details of specific folder then try command like this-

cmd /c cd c:\tmp & dir > c:\tmp\dir.txt

‘&’ allows to run two commands one by one. First it will change the directory to C:\tmp and then list the details in dir.txt file.

 

Steps to execute command using CLIP:

You can copy the output of command using CLIP command with little variation from above mentioned commands.

Open Windows Explorer and enter following command in Address bar-

cmd /c help | clip

Then open notepad and paste the clipboard content and save the file.

Similarly other commands can be used-

cmd /c chkdsk | clip

cmd /c dir | clip

cmd /c cd c:\tmp & dir | clip

Only problem with CLIP command is that you have to open a file and paste the copied content.