How to input multiple parameters when writing a batch file? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061201225247135.html
My
Program Callback calls a DOS program mydos.exe, which requires two parameters at the end of the program running. My current practice is: compile a program file mytext.txt and record the parameters to be input, such as "10 ", then write a BAT file as follows:
@ Echo off
Path/mydos.exe <path/mytest.txt
Then CreateProcess runs the BAT file, but the result is not running normally. I tried another dos program. The program needs to input parameters at the beginning and only has one parameter, but the result can run normally. My question is, is the input parameter time incorrect or is the input parameter method incorrect?
Thank you!
The dos folder separator should not be written in this way. It should be \
If there are not many parameters, you can call them as follows:
Path \ mydos.exe 10 10
Well, I haven't done batch processing for a long time. I will write a. The command in your bat file should be like this:
@ Echo off
@ For/F "delims =," % I in (mytest.txt) Do mydos.exe % I
Your mytest.txt content is: 10 10 (more parameters are available)
"Delims =," indicates that, when the separator is used, the read parameter is 10.
As for the path, you can do it yourself.
Mytest. BAT:
@ Echo off
@ For/F "delims =," % I in (mytest.txt) Do mydos.exe % I
Mytest. txt:
10 10
Myapplication:
Winexec (pchar (extractfilepath (application. exename) + 'mytest. bat'), sw_hide)
Cangwu_lee (small orange): path \ mydos.exe 10 NO! In addition, the path is correct. I wrote the "/" with my handwriting.
Sanmaotuo, it is not a parameter input from the beginning of the program.
I fixed it myself and closed the post!
How can I solve the problem? Thank you.