Poc
Poc

Reputation: 59

How to copy CMD Console Output to file after running command

Consider Example as: C:\Users>help

Output: We get list of commands for working with CMD

Expected: I want once this command is run - whatever is present in cmd console, I want to paste in some notepad file through some command (Not by Marking and Pasting).

Upvotes: 1

Views: 4089

Answers (3)

Nasir
Nasir

Reputation: 11401

For PowerShell, you can use Start-Transcript, it will save the all console output to a file.

From the documentation:

The Start-Transcript cmdlet creates a record of all or part of a Windows PowerShell session to a text file. The transcript includes all command that the user types and all output that appears on the console.

Reference: https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.host/start-transcript

Upvotes: 2

takintoolong
takintoolong

Reputation: 138

You can also use ctrl + A to select all, ctrl + C to copy, then use ctrl + v to paste into notepad.

Upvotes: -1

PKey
PKey

Reputation: 3841

Try this

C:\Users>help > help.txt

results will be in help.txt

Upvotes: 0

Related Questions