简体   繁体   English

如何在Windows上通过命令提示符输入对.exe文件的输入?

[英]How to enter input to .exe file through command prompt on Windows?

I have a .exe file that I have built from the makefile of a set of source .cpp files. 我有一个.exe文件,它是从一组源.cpp文件的makefile中构建的。 It should take in a set of inputs and write the output to a .txt file. 它应该接受一组输入并将输出写入.txt文件。 The manual I am following provides the following instruction for running it on linux: 我要遵循的手册提供了以下在Linux上运行的说明:

./xyz -l4 -w6 -k4 -iSampleInputTJU.txt -oMyOutputFile.txt -p

But I need to run it on windows 10. So I typed in: 但是我需要在Windows 10上运行它。所以我输入了:

C:>\Desktop\xyz -l4 -w6 -k4 -iSampleInputTJU.txt -oMyOutputFile.txt -p

However it tells me that it cannot open the input file. 但是它告诉我它无法打开输入文件。 I am not sure what I am doing wrong. 我不确定自己在做什么错。 Please help. 请帮忙。 Any input will be appreciated. 任何输入将不胜感激。

To execute a program, regardless of platform. 无论平台如何,都要执行程序。 The format shall be: 格式为:

<Program path> [program arg list]

The path can be relative or absolute. 路径可以是相对的或绝对的。

In your Linux shell. 在您的Linux Shell中。 You are running: 你在跑步:

./xyz -l4 -w6 -k4 -iSampleInputTJU.txt -oMyOutputFile.txt -p

You are using ./ . 您正在使用./ This means your program is under current directory. 这意味着您的程序在当前目录下。

In your windows console: 在Windows控制台中:

C:>\Desktop\xyz -l4 -w6 -k4 -iSampleInputTJU.txt -oMyOutputFile.txt -p

You are using absolute path here. 您在这里使用绝对路径。 You might not run the program under the path which your input file locates. 您可能未在输入文件所在的路径下运行该程序。 You can type dir to check the current directory see if the input file is there. 您可以键入dir来检查当前目录,以查看输入文件是否存在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM