我能听懂cmd,但不懂cmd /c。我试图从当前调用一个java程序,我使用Runtime.getRuntime()。exec(cmd /C java helloworld);这引起了我的怀疑。
当前回答
你应该感兴趣的部分是/?部分,这应该可以解决您使用该工具遇到的大多数其他问题。
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.
其他回答
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.
/C执行字符串指定的命令,然后终止。
您可以通过输入cmd /?来获取所有的cmd命令行开关。
推荐文章
- 如何在Mac上的命令行安装JQ ?
- 如何在windows中使用命令提示符(cmd)列出文件。我试过在Linux中使用“ls”,但它显示一个错误?
- 在命令行中使用Firefox截取完整页面的截图
- 在pip install -U中“-U”选项代表什么
- 如何将参数转发到bash脚本中的其他命令?
- 使用Wget进行多个同时下载?
- Unix列表命令'ls'可以输出数值chmod权限吗?
- 如何从命令行重置Jenkins安全设置?
- BAT文件执行后保持CMD打开
- 如何在命令提示符中使用空格?
- 如何使用xargs复制名称中有空格和引号的文件?
- 在单行命令行中执行多行语句
- 查找名称包含字符串的所有文件
- 如何编写多行命令?
- 解析命令行参数的最佳方法?