Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.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_Batch File - Fatal编程技术网

Windows 在批处理文件中打开并将文本传递给程序

Windows 在批处理文件中打开并将文本传递给程序,windows,batch-file,Windows,Batch File,我不熟悉批处理文件。我需要从批处理文件启动.exe。 这将启动一个提示,在这里我需要输入一个单词并按enter键。如何做到这一点 这就是我目前拥有的: @echo off title run_thermo start prgrm_x64.exe pause 我已经试过了 start prgrm_x64.exe > inputtext start prgrm_x64.exe < inputtext start prgrm_x64.exe | inputtext star

我不熟悉批处理文件。我需要从批处理文件启动.exe。 这将启动一个提示,在这里我需要输入一个单词并按enter键。如何做到这一点

这就是我目前拥有的:

@echo off
title run_thermo
start prgrm_x64.exe
pause
我已经试过了

start prgrm_x64.exe > inputtext  
start prgrm_x64.exe < inputtext  
start prgrm_x64.exe | inputtext  
start prgrm_x64.exe>inputtext
启动prgrm_x64.exe
-->在64位win10pro上工作
感谢您的帮助

通常的方法是使用“这有什么用?”?难道你不能双击程序,程序要求输入,你给它,然后你就走吗?如果您的程序是交互式的,为什么要通过批处理文件传递呢?这样更省时。。。如果我需要进行参数研究并希望使用不同的输入启动程序的多个实例,
start
命令将在新窗口中打开应用程序。这是您想要的还是要在现有窗口中启动它?
echo inputtext | prgrm_x64.exe
。它是否工作取决于exe的编程方式。echo inputtext | prgrm_x64.exe工作!!thxthanks,我试过:“start prgrm_x64.exe”和“/”不起作用我看你现在有了解决方案,但为了进一步解释-“start prgrm_x64.exeecho input | program将字符串
input
提供给程序
program
将尝试将名为
input
的文件的内容提供给程序。