启动/等待命令出现问题
@echo off
start /wait notepad
start worpad
这是我在批处理文件中编写的代码。我的目标是停止批处理文件执行,直到记事本应用程序关闭。它工作完美,但问题是,它还显示命令提示符。当我执行时,它打开命令提示符。
start /wait notepad in my batch file.
当我关闭记事本时,命令提示符会关闭。但我不想要命令提示符。我该怎么做。 我什至尝试了这些
cmd /c start /wait notepad
即使上面的命令不起作用, 。我该怎么做。如何在没有命令提示符的情况下只打开记事本并等待它关闭?
@echo off
start /wait notepad
start worpad
This is the code i have written in a batch file. My aim is to stop the batch file execution till the notepad application gets closed. Its working perfect but the thing is, Its displaying the command prompt also .Its opening the command prompt when i execute
start /wait notepad in my batch file.
The command prompt gets closed when i close my notepad. But i dont want the command prompt.How do i make that. I even tried these
cmd /c start /wait notepad
even the above command is not working. How do i make it.How do i open only notepad without the command prompt and wait till it is closed ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如我在回答一个在您之前的问题中,命令提示符窗口之所以存在,是因为它是处理批处理文件的工具。命令提示符窗口是
CMD.EXE
程序的工作窗口,就像记事本的工作窗口是您编辑文本文件的窗口一样。通常,在隐藏工作窗口的情况下运行程序是一项艰巨的任务,除非程序具有使用隐藏窗口运行的预定义模式。碰巧的是,CMD
确实没有有这样的模式。然而,有一种方法可以在窗口最小化的情况下启动程序。您只需创建程序的快捷方式(也可以是批处理文件),然后打开快捷方式的属性,并在“快捷方式”选项卡上将“运行”属性设置为“最小化”。为了更清楚地说明,这里有一个插图:
As I said in my answer to one of your previous questions, the command prompt window is there because it is the tool that processes the batch file. The command prompt window is the working window of the
CMD.EXE
program, just like Notepad's working window is the one where you are editing text files. Typically, running a program with its working window hidden is a non-trivial task, unless the program has a pre-defined mode of running with the hidden window. As it happens,CMD
does not have such a mode.However, there is a way of starting a program with its window minimised. You only need to create a shortcut to your program (it can be a batch file too), then open the shortcut's properties, and on the Shortcut tab, set the Run property to
Minimized
. To make it clearer, here's an illustration:或者也许你可以只使用
所以你的代码将像这样
@echo off
start notepad
start worpad
Or maybe you can just use the
So your code will be like this
@echo off
start notepad
start worpad