【发布时间】:2012-08-25 22:21:12
【问题描述】:
我无法为我的问题找到一个好的答案。也许有人已经有了答案,并且很乐意分享。我正在运行一个批处理文件,并且在某个时间,我想最小化批处理窗口。一些代码稍后,将其最大化或返回到实际大小。
@echo off
mode con cols=100 lines=100
echo My batch is NOT minimized. This message is from a normal window!
start "window_will_be_minimized" k:\Folder20\MiniMaxi.exe
start /wait "" cmd /c c:\Folder00\Drawing.exe
Drawing.exe 正在运行。
REM --- At this point my batch window is minimized and the MiniMaxi.exe is closed
REM --- until the Drawing.exe is closed.
Drawing.exe 现已关闭。
REM --- Immediatelly my batch window must return to its previous size.
Therefore, the MiniMaxi.exe will be launched and then closed
start "window_will_be_MAXImized" k:\Folder20\MiniMaxi.exe
echo Again, this message is from a normal window
pause > nul
exit /b
提前谢谢你
【问题讨论】:
-
感谢 EitanT,但您添加的这个链接没有清楚地解释如何在运行批处理时最小化窗口。那里的解释不清楚且未经测试
-
嗯,它确实 向您展示了如何制作一个基本的 C++ 程序,该程序可以最小化带有所选标题的窗口。这基本上就是你想要的,不是吗?
-
没有直接的方法可以做到这一点。我所看到的一切都涉及使用至少 jscript 并知道窗口以最小化ID#。我相信 EitanT 的建议是最好的。
-
@EitanT ; James K - 谢谢你的回答,但我不知道如何在上面的批处理脚本中实现那个帖子“让批处理文件最小化 DOS 窗口”。有人可以一步一步写教程吗?
标签: batch-processing batch-file