相关疑难解决方法(0)

显示Windows批处理文件中的弹出/消息框

有没有办法从批处理文件中显示消息框(类似于如何xmessage在Linux中使用bash-scripts)?

windows command-line batch-file messagebox

144
推荐指数
11
解决办法
54万
查看次数

为什么延迟扩展在管道代码块内部失败?

这是一个简单的批处理文件,它演示了如果延迟扩展在正在通过管道传输的块中,它将如何失败.(失败是在脚本的末尾)任何人都可以解释为什么这是?

我有一个解决方法,但它需要创建一个临时文件.我最初在查找文件时遇到了这个问题,并在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)

pipe batch-file

31
推荐指数
3
解决办法
1万
查看次数

从批处理文件中重定向stdout和stderr

有没有办法从它内部重定向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.exec.exe会去stdout.log

这可能吗?

stdout batch-file stderr

17
推荐指数
2
解决办法
2万
查看次数

标签 统计

batch-file ×3

command-line ×1

messagebox ×1

pipe ×1

stderr ×1

stdout ×1

windows ×1