简体   繁体   English

将参数传递给命令exe程序

[英]passing parameters to command exe program

I want to pass 3 seperate parameters into a cmd.exe program using a batch file. 我想使用批处理文件将3个单独的参数传递到cmd.exe程序中。 I have the following line of code that is able to call the program with the initial method: 我有以下代码行,可以使用初始方法调用程序:

@echo off
CMD /k ""C:\Users\user\Desktop\import\import.exe"" import -i   C:\Users\user\Desktop\testFolder\text.txt -d C:\Users\rsubedi\Desktop\testFolder
pause

this piece of code works great by calling the program with import -i C:\\Users\\user\\Desktop\\testFolder\\text.txt -d C:\\Users\\rsubedi\\Desktop\\testFolder as the parameters. 通过使用import -i C:\\Users\\user\\Desktop\\testFolder\\text.txt -d C:\\Users\\rsubedi\\Desktop\\testFolder作为参数调用该程序,这段代码可以很好地工作。

Where i am Stuck: 我被困在哪里:

Now i want to wait until the program is done then pass the username to the same program then wait for the program to verify the username then enter the password. 现在,我想等待程序完成,然后将用户名传递给同一程序,然后等待程序验证用户名,然后输入密码。

try this: 尝试这个:

C:\Users\user\Desktop\import\import.exe import -i   C:\Users\user\Desktop\testFolder\text.txt -d C:\Users\rsubedi\Desktop\testFolder

Remove the cmd /k command. 删除cmd /k命令。

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

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