I want to cut and paste from cmd and keep the color information when pasting to another application. It's similar to pasting in most applications with formatting information.
Is there a way to do this? Or can it be done with an app similar to cmd?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
The PowerShell folks, on their blog, posted an article titled: Colorized capture of console screen in HTML and RTF
Once it's in a RTF file, with colors, open the RTF with Word or OpenOffice and copy the text to your target application.
As PowerShell is a nice replacement of cmd.exe with a lot more features, give it a try.
Snark's answer is useful, but the link is broken. The updated link to the MSDN blog post is here: Colorized capture of console screen in HTML and RTF
You need to copy the functions from the blog post and then paste them into PowerShell. And then you can run commands like:
$htmlFileName = "$env:temp\ConsoleBuffer.html"
.\Get-ConsoleAsHtml | out-file $htmlFileName -encoding UTF8
Windows Terminal can be handy with its
copyFormatting setting (https://docs.microsoft.com/en-us/windows/terminal/customize-settings/interaction).
There is a long winded way of doing it, using screen capture?
Then those screen capture shots, will be ready to be inserted into Word as an image for documenting purposes. Of course, it's not text, so it won't be selectable. But it may be better than nothing.