找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 26797|回复: 9

[其他] 有关mtee v2.21版本的参数/E的问题

[复制链接]
发表于 2017-1-10 23:35:35 | 显示全部楼层 |阅读模式
最近发现mtee升级到了最新的2.21版本,下载下来后发现,里面新增了一个参数 /E,貌似是在可以将errorlevel在使用管道
后仍然可见,但是我一直没有试验成功,求大神帮忙分析一下

MTEE v2.21 Win32 Commandline Standard Stream Splitter for Windows XP .. 10.
Copyright (c) 2001-2016 Ritchie Lawrence, http://www.commandline.co.uk.

  MTEE [/A | /U] [/C] [/D] [/T] [/E] [[/+] file] [...]

  /A    Convert output to ANSI. Default output is same as input.
  /C    Continue if errors occur opening/writing to file (advanced users only).
  /D    Prefix each line of output with local date in YYYY-MM-DD format.
  /T    Prefix each line of output with local time in HH:MM:SS.MSS format.
  /U    Convert output to UNICODE. Default output is same as input.
  /E    Exit with exit code of piped process.
  /+    Append to existing file. If omitted, existing file is overwritten.
  file  File to receive the output. File is overwritten if /+ not specified.
  ...   Any number of additional files. Use /+ before each file to append.

  Example usage:-

  1) script.cmd | mtee result.txt
  2) ftp -n -s:ftp.scr | mtee local.log /+ \\server\logs$\remote.log
  3) update.cmd 2>&1 | mtee/d/t/+ log.txt

  1) Sends the output of script.cmd to the console and to result.log. If
     result.txt already exists, it will be overwritten.
  2) Sends output of automated ftp session to the console and two log files,
     local.log is overwritten if it already exists, remote.log is appended to.
  3) Redirects stdout and stderr from update.cmd to console and appends to
     log.txt. Each line is prefixed with local date and time.
发表于 2017-1-11 20:20:26 | 显示全部楼层
你的测试用例和测试结果在哪里?
 楼主| 发表于 2017-1-11 20:43:09 | 显示全部楼层
回复 2# GNU


aaa.bat
@echo off
echo testing mtee
exit /b 1

bbb.bat
call aaa.bat | mtee /E
echo %errorlevel%

执行bbb.bat后,输出结果仍然是0
发表于 2017-1-11 21:47:51 | 显示全部楼层
回复 3# shootman2


bbb.bat改成这样:
call aaa.bat | mtee /E 1.log
echo %errorlevel%
 楼主| 发表于 2017-1-12 23:09:14 | 显示全部楼层
回复 4# Batcher


    执行结果还是输出 0
发表于 2017-1-13 10:56:20 | 显示全部楼层
回复 5# shootman2


    我这边测试是 1
 楼主| 发表于 2017-1-13 21:42:22 | 显示全部楼层
回复 6# Batcher


    你的操作系统版本是多少呢?
发表于 2017-1-14 01:13:44 | 显示全部楼层
回复 7# shootman2


    Win7 SP1
 楼主| 发表于 2017-1-17 00:11:38 | 显示全部楼层
回复 8# Batcher


    你的系统版本应该是32位的吧?我在win xp 32位下测试是ok的,但是在win7 sp1 64位上测试返回是0
发表于 2017-1-18 12:01:44 | 显示全部楼层
回复 9# shootman2


    我也是64位
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-17 12:40 , Processed in 0.018870 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表