windows 通过批处理命令全屏?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4914858/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:07:52  来源:igfitidea点击:

Full screen through batch command?

windowsbatch-filebatch-processing

提问by mr_eclair

I have a batch script under Windows. When anyone will click on that script I want the command window to become full screen like we do by keyboard shortcut [Alt+Enter].

我在 Windows 下有一个批处理脚本。当有人点击该脚本时,我希望命令窗口变成全屏,就像我们通过键盘快捷键所做的那样[Alt+Enter]

Can it be done automatically using any command in batch file?

可以使用批处理文件中的任何命令自动完成吗?

回答by DVK

In Windows XP, you need to start your program maximized (but not full screen) via "start /max" as follows:

在 Windows XP 中,您需要通过“start /max”最大化(但不是全屏)启动程序,如下所示:

start "Winow Title" /MAX "C:\batches\myfile.bat"

This command would be inside your original batch file, and call the real bath file.

此命令将在您的原始批处理文件中,并调用真正的 Bath 文件。

I don't think there's a way to change the full screen-ness of an executing "cmd" command from within a batch fileabsent someone writing a special app to do so by emulating sending Alt+Enterto the parent process.

我不认为有一种方法可以从批处理文件中更改正在执行的“cmd”命令的全屏状态,而无需有人编写一个特殊的应用程序来通过模拟发送Alt+Enter到父进程来这样做。

In Windows 7 (and probably Vista) you must run inside XP virtual machine for full screen mode.

在 Windows 7(也可能是 Vista)中,您必须在 XP 虚拟机中运行以实现全屏模式。

回答by Joey

There is none. You can write a small program doing so for you, though. There is the SetConsoleDisplayModefunction.

空无一人。不过,您可以为此编写一个小程序。有SetConsoleDisplayMode功能。