.bat文件,非阻塞运行/推出 [英] .bat files, nonblocking run/launch

查看:437
本文介绍了.bat文件,非阻塞运行/推出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何发起一次2应用在.bat文件?我目前的案文

  CD MYDIR
my.exe
my.exe difParams
//蝙蝠结束。我不想my.exe关闭


解决方案

 启动my.exe

这踢的exe关闭的背景。

start命令提供了一些选项太多,可以使用启动/ 来一一列举:

  C:>启动/?
启动另一个窗口运行指定的程序或命令。启动[标题] [/ D路径] [/ I] [/ MIN] [/ MAX] [/分离式| /共享]
      [/ LOW | /作者| / HIGH | / REALTIME | / ABOVENORMAL | /低于一般]
      [/节点< NUMA节点>] [/亲和性LT;六角亲和力掩码与GT;] [/ WAIT] [/ B]
      [命令/程序] [参数]    标题标题到窗口的标题栏中显示。
    路径起始目录。
    b启动应用程序,而无需创建一个新的窗口。该
                应用程序有^ C处理忽略。除非应用程序
                使^ C处理,^ Break是唯一可以中断的唯一途径
                应用程序。
    我新的环境将在原来的环境传递
                到CMD.EXE,而不是当前的环境。
    MIN启动窗口最小化。
    MAX启动窗口最大化。
    单独的开始16位Windows程序在单独的内存空间。
    SHARED启动16位Windows程序共享内存空间。
    在IDLE优先级低的启动应用程序。
    在NORMAL优先级正常启动的应用程序。
    在高优先级高启动应用程序。
    在实时优先级REALTIME启动应用程序。
    在ABOVENORMAL优先级ABOVENORMAL启动应用程序。
    BELOWNORMAL开始在BELOWNORMAL优先级的应用。
    节点指定preferred非统一内存架构(NUMA)
                节点为十进制整数。
    AFFINITY指定处理器关联掩码为十六进制数。
                该过程被限制在这些处理器上运行。                亲和力掩码是PTED不同间$ P​​ $当/ AFFINITY和
                / NODE组合。指定关联掩码仿佛NUMA
                节点的处理器掩码右移,开始在零位。
                该过程被限制在这些处理器上运行
                指定的关联掩码和NUMA节点之间常见。
                如果没有处理器是通用的,该过程被限制到
                指定的NUMA节点上运行。
    WAIT启动应用程序并等待它终止。
    命令/程序
                如果它是一个内部cmd命令或随后批处理文件
                命令处理器与/ K开关运行CMD.EXE。
                这意味着,窗口将保持该命令后
                已运行。                如果不是内部cmd命令或批文件,则
                它是一个程序,将运行无论是作为窗口应用程序
                或者控制台应用程序。    参数这些是传递到命令/程序的参数。

一个棘手位可以是标题的可执行文件之前来了,它的参数,所以有时你需要给应用程序一个标题只是为了让开始正确地分析论证。 : - |

How do i launch 2 apps at once in a .bat file? my current text is

cd mydir
my.exe
my.exe difParams
//bat is finished. i dont want my.exe to close

解决方案

start my.exe 

That kicks the exe off in the background.

The start command offers some options too, use start /? to list them:

C:>start /?  
Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
      [command/program] [parameters]

    "title"     Title to display in window title bar.
    path        Starting directory.
    B           Start application without creating a new window. The
                application has ^C handling ignored. Unless the application
                enables ^C processing, ^Break is the only way to interrupt
                the application.
    I           The new environment will be the original environment passed
                to the cmd.exe and not the current environment.
    MIN         Start window minimized.
    MAX         Start window maximized.
    SEPARATE    Start 16-bit Windows program in separate memory space.
    SHARED      Start 16-bit Windows program in shared memory space.
    LOW         Start application in the IDLE priority class.
    NORMAL      Start application in the NORMAL priority class.
    HIGH        Start application in the HIGH priority class.
    REALTIME    Start application in the REALTIME priority class.
    ABOVENORMAL Start application in the ABOVENORMAL priority class.
    BELOWNORMAL Start application in the BELOWNORMAL priority class.
    NODE        Specifies the preferred Non-Uniform Memory Architecture (NUMA)
                node as a decimal integer.
    AFFINITY    Specifies the processor affinity mask as a hexadecimal number.
                The process is restricted to running on these processors.

                The affinity mask is interpreted differently when /AFFINITY and
                /NODE are combined.  Specify the affinity mask as if the NUMA
                node's processor mask is right shifted to begin at bit zero.
                The process is restricted to running on those processors in
                common between the specified affinity mask and the NUMA node.
                If no processors are in common, the process is restricted to
                running on the specified NUMA node.
    WAIT        Start application and wait for it to terminate.
    command/program
                If it is an internal cmd command or a batch file then
                the command processor is run with the /K switch to cmd.exe.
                This means that the window will remain after the command
                has been run.

                If it is not an internal cmd command or batch file then
                it is a program and will run as either a windowed application
                or a console application.

    parameters  These are the parameters passed to the command/program.

A tricky bit can be that the "title" comes before the executable and it's parameters, so sometimes you need to give the app a title just to get start to parse the arguments correctly. :-|

这篇关于.bat文件,非阻塞运行/推出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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