我能听懂cmd,但不懂cmd /c。我试图从当前调用一个java程序,我使用Runtime.getRuntime()。exec(cmd /C java helloworld);这引起了我的怀疑。
CMD.exe
Start a new CMD shell
Syntax
CMD [charset] [options] [My_Command]
Options
**/C Carries out My_Command and then
terminates**
从帮助。
你应该感兴趣的部分是/?部分,这应该可以解决您使用该工具遇到的大多数其他问题。
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\>cmd /? Starts a new instance of the Windows XP command interpreter CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string] /C Carries out the command specified by string and then terminates /K Carries out the command specified by string but remains /S Modifies the treatment of string after /C or /K (see below) /Q Turns echo off /D Disable execution of AutoRun commands from registry (see below) /A Causes the output of internal commands to a pipe or file to be ANSI /U Causes the output of internal commands to a pipe or file to be Unicode /T:fg Sets the foreground/background colors (see COLOR /? for more info) /E:ON Enable command extensions (see below) /E:OFF Disable command extensions (see below) /F:ON Enable file and directory name completion characters (see below) /F:OFF Disable file and directory name completion characters (see below) /V:ON Enable delayed environment variable expansion using ! as the delimiter. For example, /V:ON would allow !var! to expand the variable var at execution time. The var syntax expands variables at input time, which is quite a different thing when inside of a FOR loop. /V:OFF Disable delayed environment expansion.
推荐文章
- 如何循环通过文件匹配通配符在批处理文件
- 异步运行Windows批处理文件命令
- 我怎么能显示线在公共(反向差异)?
- Git显示“警告:永久添加到已知主机列表”
- 为什么git在Windows下记不住我的密码
- 如何在文本文件中替换${}占位符?
- 如何在批处理文件中请求管理员访问
- 如何在Mac OS Lion上从命令行启动MySQL服务器?
- 从Windows批处理文件设置系统环境变量?
- 如何使用文件的行作为命令的参数?
- BAT文件:打开新的cmd窗口并在其中执行命令
- 如何做一个非贪婪匹配在grep?
- 如何在IntelliJ IDEA中输入命令行参数?
- Shell命令查找两个文件中的公共行
- 顺序运行NPM脚本