I would like to know if there is a way to save mkvmerge output (=what appear on the windows terminal) in a .txt file.
Aternatively in do like this in 2 steps:
command>txt.txt
type “txt.txt”
But i don’t really like it because i would like to compile on the window terminal and save at the same time. I know some soft cli offer this possibility
Using the syntax … ^| … is definitely wrong. The ^ resets the special meaning of the pipe operator | and passes a verbatim | character to mkvmerge as a command line parameter along with all the following words. mkvmerge then thinks | is a file name & doesn’t find a file with that name.
Put differently, what I wrote mkvmerge <arguments> | Tee-Object -FilePath output.txt is interpreted by PowerShell as:
Start two programs. The first one is mkvmerge with command line arguments <arguments>. The second one is Tee-Object (a PowerShell scriptlet) with command line arguments -FilePath output.txt. Take the output of the first program and hand it over to the second program.
Whereas what you wrote, mkvmerge <arguments> ^| Tee-Object -FilePath output.txt, is interpreted as:
Start only one program, mkvmerge, with command line arguments <arguments> | Tee-Object -FilePath output.txt. Take its output & print it on the console.
Sorry, but I really cannot help you with the console crashing. The first command you’ve shown looks good to me; it works on my end with slightly altered paths:
oh that is the thing, i tried it in cmd.exe.
How do i run in powershell ?
i have create a .bat with thousands of lines and the mkvmerge command is one of them. can i safely run a .bat through powershell or will it make a lot of unexpected problem ?
If that is not possible i will forget this idea to get the output both on console and .txt because my .txt is a hundreads of hours already
Sorry, but I’m not doing general Windows support here. Google for how to use the PowerShell, learn about PowerShell scripts (those with .ps1 as the extension). Or look into finding a Windows port of the Unix tool tee if you want to continue using cmd.exe; it does pretty much similar things as the PowerShell-built-in function Tee-Object.