简体   繁体   English

以编程方式关闭命令提示符窗口

[英]Close the command prompt window programmatically

I have a set of commands in batch file which is used to run the JAR file.It is working perfectly. 我在批处理文件中有一组命令,用于运行JAR文件。它运行良好。

After running the program, the command prompt window doesn't get closed. 运行该程序后,命令提示符窗口不会关闭。 If I manually close the window, then the application closes as well. 如果我手动关闭窗口,那么应用程序也会关闭。

So I want to close the command window without affecting the application. 所以我想关闭命令窗口而不影响应用程序。

thanks in advance. 提前致谢。

Either use exit or make a new method to go to and have nothing in it. 请使用exit或使用一种新方法进行操作,使其不包含任何内容。 The exit way is better though. 退出方式比较好。 :) :)

My psychic debugging powers tell me you're launching the JAR file using a java command instead of a javaw command. 我灵敏的调试能力告诉我,您正在使用java命令而不是javaw命令启动JAR文件。

Use javaw instead and the command window will close when the batch file exits. 使用javaw代替,当批处理文件退出时,命令窗口将关闭。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM