Saved Bookmarks
| 1. |
Solve : how to echo line both on screen and text file? |
|
Answer» I want to display the output both on screen and log.txt file Unlike most Nix systems there is not a native way to do this in batch. You can use the TEE command on most NIX operating systems to do this. I believe there is a Win32 port of it if you really want to do this. There are plenty of Tee.exe programs around, not to mention any number of Tee.bat. Tee.cmd and Tee.vbs scripts. The most cursory of Google searches will turn up plenty of results, which it would be both tedious and redundant to reproduce here. In particular searching the Google archive of alt.msdos.batch.nt using INTELLIGENTLY chosen search terms is a fruitful method of finding solutions. If the OP is using a business or school system where installation of third party EXECUTABLES is not allowed, then a cmd or vbs approach may be the only way. You can use: echo %%a >> log.txt echo %%a in one line, maybe use a pipe, fork, or do: echo %%a >> log.txt && echo %%a Thats your best option |
|