简体   繁体   中英

passing parameters to command exe program

I want to pass 3 seperate parameters into a cmd.exe program using a batch file. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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