运行批处理文件时如何不打开Cmd窗口 [英] how not to open a Cmd window when running a batch file

查看:707
本文介绍了运行批处理文件时如何不打开Cmd窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写的每个批处理文件都会打开一个Cmd窗口,并保持打开状态,直到程序完成. .bat文件中包含的,不打开CMD窗口或打开并立即隐藏它的命令字符串是什么?我必须保持在MSW7 Pro内置编程的范围内.现在,我只是在使用msg命令来弄清楚这个问题.为了获得成功,只有消息窗口本身应该出现在屏幕上.

Every batch file I write opens a Cmd window and leaves it open until the program is completed. What is the command string to include in the .bat file to either not open the CMD window or open it and immediately hide it? I must stay within the confines of MSW7 Pro's built in programming. Right now, I'm just playing with the msg command to get this figured out. For success, only the message window itself should appear on screen.

推荐答案

如果要启动批处理文件,请使用:

If you are starting a batch file then use:

cmd /c "Your Command and Parameters"

如果要让批处理文件关闭cmd窗口,请在批处理文件的末尾放置exit

If you want the batch file to close the cmd window, then put exit at the end of the batch file

@echo My Batch File
exit

此外,start命令可能会为您提供帮助.可以设置为最小化窗口.

As a further though, the start command might help you. It can be set to minimize the window.

START /MIN MyBatch.Bat

这篇关于运行批处理文件时如何不打开Cmd窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆