有没有办法从批处理文件中显示消息框(类似于如何xmessage在Linux中使用bash-scripts)?
这是一个简单的批处理文件,它演示了如果延迟扩展在正在通过管道传输的块中,它将如何失败.(失败是在脚本的末尾)任何人都可以解释为什么这是?
我有一个解决方法,但它需要创建一个临时文件.我最初在查找文件时遇到了这个问题,并在Windows批处理文件中按大小排序
@echo off
setlocal enableDelayedExpansion
set test1=x
set test2=y
set test3=z
echo(
echo NORMAL EXPANSION TEST
echo Unsorted works
(
echo %test3%
echo %test1%
echo %test2%
)
echo(
echo Sorted works
(
echo %test3%
echo %test1%
echo %test2%
) | sort
echo(
echo ---------
echo(
echo DELAYED EXPANSION TEST
echo Unsorted works
(
echo !test3!
echo !test1!
echo !test2!
)
echo(
echo Sorted fails
(
echo !test3!
echo !test1!
echo !test2!
) | sort
echo(
echo …Run Code Online (Sandbox Code Playgroud) 有没有办法从它内部重定向stdout和stderr批处理文件.
我在想象类似的东西
set STDOUT=stdout.log
echo Some text
a.exe
b.exe
c.exe
Run Code Online (Sandbox Code Playgroud)
如果双方Some text和输出a.exe,b.exe并c.exe会去stdout.log
这可能吗?