start / wait命令有问题 [英] Problem with the start /wait command

查看:1102
本文介绍了start / wait命令有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

            @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 ?

推荐答案

由于我没有命令提示符,所以我只打开记事本在我的回答中您的一个先前的问题,命令提示符窗口在那里,因为它是处理批处理文件的工具。命令提示符窗口是 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:

这篇关于start / wait命令有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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