windows 通过命令提示符最小化打开的程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23057448/
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-09 11:30:24  来源:igfitidea点击:

open program minimized via command prompt

windowscommand-prompt

提问by barbar

I have a windows 8.1 machine and I want to open a program with minimized window. For a program like notepad, I just use the following command:

我有一台 Windows 8.1 机器,我想打开一个窗口最小化的程序。对于记事本这样的程序,我只使用以下命令:

start /min "" "C:\Windows\notepad.exe"  

and then a new notepad window starts in minimized mode.

然后一个新的记事本窗口以最小化模式启动。

The problem is that not all programs do this. When I want to start for instance MS Word in minimized mode I use:

问题是并非所有程序都这样做。例如,当我想以最小化模式启动 MS Word 时,我使用:

start /min "" "C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE"

but then a new Word windows starts up in MAXIMIZED mode.

但随后一个新的 Word 窗口以 MAXIMIZED 模式启动。

Is there a way to start it minimized?

有没有办法启动它最小化?

回答by Jayaraj

I tried this commands in my PC.It is working fine....

我在我的电脑上试过这个命令。它工作正常......

To open notepad in minimized mode:

以最小化模式打开记事本:

start /min "" "C:\Windows\notepad.exe"

启动 /min "" "C:\Windows\notepad.exe"

To open MS word in minimized mode:

以最小化模式打开 MS word:

start /min "" "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE"

启动 /min "" "C:\Program Files\Microsoft Office\Office14\WINWORD.EXE"

回答by Allan Denis

Try this

尝试这个

  1. Go to the propertiesof the shortcut that points to the program (ALT ENTERor right click->properties); if there is no shortcut to it, you can make it by dragging and dropping the program while holding CTRL SHIFT;

  2. Click in the Normal windowdropdown, and choose minimized;

  3. Save and run the shortcut.

  1. 转到properties指向程序的快捷方式(ALT ENTERright click-> properties);如果没有快捷方式,可以通过按住 拖放程序来制作CTRL SHIFT

  2. 单击Normal window下拉菜单,然后选择minimized;

  3. 保存并运行快捷方式。

回答by electrodog

You could try using the third-party tool called NirCmd. It is a genuine, free command line utility. If or when you have it, use this code in a batch file:

您可以尝试使用名为 NirCmd 的第三方工具。它是一个真正的、免费的命令行实用程序。如果您拥有它,请在批处理文件中使用此代码:

title Open Word
nircmd win hide title "Open Word"
start "C:\Program" "Files" "(x86)\Microsoft" "Office\Office12\WINWORD.exe
nircmd wait 20
nircmd win min foreground
exit

This program, in order, changes its title, hides itself according to its title, starts Word, waits 20 milliseconds as a buffer for Word to settle, minimizes Word by assuming it is now the top window, and then exits itself. This program should work as intended as long as their are no key presses or clicks in that ~50 millisecond time window, which shouldn't be hard.

该程序按顺序更改其标题,根据其标题隐藏自身,启动 Word,等待 20 毫秒作为 Word 建立的缓冲区,通过假设 Word 现在是顶部窗口来最小化 Word,然后退出自身。只要在大约 50 毫秒的时间窗口内没有按键或点击,这个程序就应该按预期工作,这应该不难。

As for installing nircmd on your computer, use this link, and click "Download NirCmd" at the bottom of the page. Save the .zip folder to a normal directory (like "My Documents"), extract it, and copy "nircmd.exe" to %systemroot%\system32, and there you go. Now you have nircmd included with your command line utilities.

至于在您的计算机上安装 nircmd,请使用此链接,然后单击页面底部的“下载 NirCmd”。将 .zip 文件夹保存到一个普通目录(如“我的文档”),解压缩,然后将“nircmd.exe”复制到 %systemroot%\system32,然后就可以了。现在,您的命令行实用程序中包含了 nircmd。

回答by yendao42

Try:

尝试:

start  "" "C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE" --new-window/min

I had the same problem, but I was trying to open chrome.exe maximized. If I put the /minanywhere else in the command line, like before or after the empty title, it was ignored.

我有同样的问题,但我试图打开 chrome.exe 最大化。如果我把/min命令行 中的其他任何地方,比如在空标题之前或之后,它就会被忽略。

回答by dobrivoje

Local Windows 10 ActiveMQ server :

本地 Windows 10 ActiveMQ 服务器:

@echo off
start /min "" "C:\Install\apache-activemq.15.10\bin\win64\activemq.bat" start

回答by Wagner_SOFC

For the people which are looking for the opposite (aka fullscreen), it's very simple. Because you just have to replace the settings /minby /max.

对于正在寻找相反(又名全屏)的人来说,这非常简单。因为你只需要更换设置/min/max

Now the program will be open at the "maximized" size !In the case, perhaps you will need an example : start /max explorer.exe.

现在程序将以“最大化”大小打开!在这种情况下,也许您需要一个示例:start /max explorer.exe

回答by Bibaswann Bandyopadhyay

If the application is already open (even in background), it will be restored by "start" command. Exit the program if running then /max or /min will work

如果应用程序已经打开(即使在后台),它将通过“启动”命令恢复。如果正在运行则退出程序,然后 /max 或 /min 将起作用