startstart

启动单独的命令提示符窗口以运行指定的程序或命令。Starts a separate Command Prompt window to run a specified program or command.

语法Syntax

start [<title>] [/d <path>] [/i] [{/min | /max}] [{/separate | /shared}] [{/low | /normal | /high | /realtime | /abovenormal | belownormal}] [/affinity <hexaffinity>] [/wait] [/elevate] [/b] [<command> [<parameter>... ] | <program> [<parameter>... ]]

参数Parameters

参数Parameter 说明Description
<title> 指定要在 命令提示符 窗口标题栏中显示的标题。Specifies the title to display in the Command Prompt window title bar.
/d <path>/d <path> 指定启动目录。Specifies the startup directory.
/i/i 将 Cmd.exe 启动环境传递到新的 命令提示符 窗口。Passes the Cmd.exe startup environment to the new Command Prompt window. 如果未指定 /i ,则使用当前环境。If /i is not specified, the current environment is used.
{/min | /max} 指定在新的命令提示符窗口) 最大程度地降低 (/min) 或最大化 (/maxSpecifies to minimize (/min) or maximize (/max) the new Command Prompt window.
{/separate | /shared} 在单独的内存空间中启动16位程序, (/separate) 或共享内存空间 (/shared) 。Starts 16-bit programs in a separate memory space (/separate) or shared memory space (/shared). 64位平台上不支持这些选项。These options are not supported on 64-bit platforms.
{/low | /normal | /high | /realtime | /abovenormal | belownormal} 启动指定优先级类中的应用程序。Starts an application in the specified priority class.
/affinity <hexaffinity>/affinity <hexaffinity> 将指定的处理器关联掩码 (表示为) 到新应用程序的十六进制数。Applies the specified processor affinity mask (expressed as a hexadecimal number) to the new application.
/wait/wait 启动应用程序并等待其结束。Starts an application and waits for it to end.
/elevate/elevate 以管理员身份运行应用程序。Runs application as administrator.
/b/b 启动应用程序而不打开新的 命令提示符 窗口。Starts an application without opening a new Command Prompt window. 除非应用程序启用了 CTRL + C 处理,否则将忽略 CTRL + C 处理。CTRL+C handling is ignored unless the application enables CTRL+C processing. 使用 CTRL + BREAK 中断应用程序。Use CTRL+BREAK to interrupt the application.
[<command> [<parameter>... ] | <program> [<parameter>... ]] 指定要启动的命令或程序。Specifies the command or program to start.
<parameter> 指定要传递给命令或程序的参数。Specifies parameters to pass to either the command or the program.
/?/? 在命令提示符下显示帮助。Displays help at the command prompt.

备注Remarks

  • 您可以通过将文件的名称键入为命令,通过文件关联来运行非可执行文件。You can run non-executable files through their file association by typing the name of the file as a command.

  • 如果运行的命令包含字符串 CMD 作为第一个不带扩展名或路径限定符的标记,则 CMD 将替换为 COMSPEC 变量的值。If you run a command that contains the string CMD as the first token without an extension or path qualifier, CMD is replaced with the value of the COMSPEC variable. 这会阻止用户从当前目录中提取 cmdThis prevents users from picking up cmd from the current directory.

  • 如果 (GUI) 应用程序运行32位图形用户界面,则 cmd 在返回到命令提示符之前不会等待应用程序退出。If you run a 32-bit graphical user interface (GUI) application, cmd does not wait for the application to quit before returning to the command prompt. 如果从命令脚本运行应用程序,则不会发生此行为。This behavior does not occur if you run the application from a command script.

  • 如果运行的命令使用了不包含扩展的第一个令牌,Cmd.exe 将使用 PATHEXT 环境变量的值来确定要查找的扩展以及顺序。If you run a command that uses a first token that does not contain an extension, Cmd.exe uses the value of the PATHEXT environment variable to determine which extensions to look for and in what order. PATHEXT 变量的默认值为:The default value for the PATHEXT variable is:

    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    

    请注意,语法与 PATH 变量相同,分号 (; ) 分隔每个扩展名。Note that the syntax is the same as the PATH variable, with semicolons (;) separating each extension.

  • 搜索可执行文件时,如果任何扩展上都没有匹配项,则 开始 检查该名称是否与目录名称匹配。When searching for an executable file, if there is no match on any extension, start checks to see if the name matches a directory name. 如果是这样, 请在 该路径上打开 Explorer.exe。If it does, start opens Explorer.exe on that path.

示例Examples

若要在命令提示符下启动 Myapp 程序并保留使用当前的 " 命令提示符 " 窗口,请键入:To start the Myapp program at the command prompt and retain use of the current Command Prompt window, type:

start Myapp

若要在单独的最大化命令提示符窗口中查看启动命令行帮助主题,请键入:To view the start command-line help topic in a separate maximized Command Prompt window, type:

start /max start /?

其他参考Additional References