To expand on davor’s answer, you can use PowerShell like this:
powershell "dir | tee test.txt"
If you’re trying to redirect the output of an exe in the current directory, you need to use .\
on the filename, eg:
powershell ".\something.exe | tee test.txt"
More Related Contents:
- Command Prompt Separation of text by Character [closed]
- What are the undocumented features and limitations of the Windows FINDSTR command?
- What are the ERRORLEVEL values set by internal cmd.exe commands?
- Defining and using a variable in batch file
- Assign command output to variable in batch file
- Can I mask an input text in a bat file?
- Which cmd.exe internal commands clear the ERRORLEVEL to 0 upon success?
- Error: “is not recognized as an internal or external command, operable program or batch file”
- Why doesn’t this FINDSTR example with multiple literal search strings find a match?
- How to read and print contents of text file line by line?
- Logical operators (“and”, “or”) in DOS batch
- using batch echo with special characters
- What does single-quoting do in Windows batch files?
- How to create empty text file from a batch file?
- How can a batch file run a program and set the position and size of the window?
- How to search and replace a string that have an equal-to sign “=” inside
- Arithmetic operations with HH:MM:SS times in batch file
- How do I compare timestamps of files in a batch script?
- Open a URL without using a browser from a batch file
- Why are Danish characters not displayed as in text editor on executing batch file?
- How to automatically close cmd window after batch file execution?
- How can I escape an exclamation mark ! in cmd scripts?
- Does Windows batch support exception handling?
- Batch – Converting variable to uppercase
- Get java version from batch file
- Set a path variable with spaces in the path in a Windows .cmd file or batch file
- Batch file for PuTTY/PSFTP file transfer automation
- Batch file and DEL errorlevel 0 issue
- How do I create a batch file timer to execute / call another batch throughout the day
- To “Call” or “Not to Call” a batch file?