从命令行关闭窗口(在 Windows 上)

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

Close window from command line (on windows)

windowscommand-line

提问by mrtsherman

Is it possible to send a close command to an application from command line? I know that I can kill the process, but it seems a bit heavy handed. If not from command line, another suggestion?

是否可以从命令行向应用程序发送关闭命令?我知道我可以终止该进程,但似乎有点笨手笨脚。如果不是从命令行,另一个建议?

采纳答案by Norbert Willhelm

You can use taskkill (without the option -f) for that purpose.

为此,您可以使用 taskkill(不带选项 -f)。

回答by Dallas

I'm sure you know you can use Task Manager to close programs... and alternatively you can monitor and shut down processes easily with it's bigger cousin Process Explorer.

我相信你知道你可以使用任务管理器来关闭程序......或者你可以使用它更大的表亲Process Explorer轻松监控和关闭进程