Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 批处理文件/通过命令行启动程序的命令_Windows_Command Line_Batch File_Command Prompt - Fatal编程技术网

Windows 批处理文件/通过命令行启动程序的命令

Windows 批处理文件/通过命令行启动程序的命令,windows,command-line,batch-file,command-prompt,Windows,Command Line,Batch File,Command Prompt,我有一个程序,我想开始使用命令提示符,同时我想传递2个参数给它。 例如,当我想启动我的程序时,我会打开命令提示符(在XP:start>run中,键入cmd,按return),然后键入: c:\rand\anotherfolder\myprogram.exe 10 20 因为我对批处理文件一无所知,所以我要问两件事: 我可以创建一个批处理文件来自动化这个过程吗 如果是,如何:D 如果您回复我的评论,我将编辑此命令,但如果您只想通过批处理文件执行此命令(而您对批处理文件一无所知): 打开文本编辑

我有一个程序,我想开始使用命令提示符,同时我想传递2个参数给它。 例如,当我想启动我的程序时,我会打开命令提示符(在XP:start>run中,键入
cmd
,按
return
),然后键入:

c:\rand\anotherfolder\myprogram.exe 10 20
因为我对批处理文件一无所知,所以我要问两件事:

  • 我可以创建一个批处理文件来自动化这个过程吗
  • 如果是,如何:D

如果您回复我的评论,我将编辑此命令,但如果您只想通过批处理文件执行此命令(而您对批处理文件一无所知):

  • 打开文本编辑器(例如记事本)
  • 键入命令(例如c:\rand\aotherfolder\myprogram.exe 10 20)
  • 将文件另存为mybatchfile.cmd
  • 双击文件(在Windows资源管理器等中)

  • 请你澄清一下;您想要一个包含两个参数并将其传递给“myprogram.exe”的批处理文件,还是想要一个运行“myprogram.exe”且具有两个固定值(10和20)的批处理文件?批处理文件实际上是在命令行上执行的一批命令。这就是我要找的。谢谢。@plymouth223,我怎样才能要求用户在命令提示符下输入值,就像我不想硬编码10,20一样?