twapi:: create_process c:\katexie\wpa_supplicant.exe -cmdline -
i{2165EB16-49D0-A553-C0E6E25330D1} -cmdline -copen.conf -cmdline -d
but the returned message tell me the file cann't be found.
but if i enter it in DOS command window:
c:\katexie\wpa_supplicant.exe -i{2165EB16-49D0-A553-
C0E6E25330D1} -copen.conf -cmdline -d
the program can run.
So I don't know how to use create_process to run this program?
Could you please give me a hand? thanks.
You are having two problems:
1) The backslaches in the executable name are substituted by Tcl to:
c:katexiewpa_supplicant.exe which indeed cannot be found.
2) -cmdline of create_process (probably) requires a single argument.
Try this instead:
twapi:: create_process {c:\katexie\wpa_supplicant.exe} -cmdline {-
i{2165EB16-49D0-A553-C0E6E25330D1} -cmdline -copen.conf -d}
Mark
Mark
thank you, Mark.
I have tried the modified command,
twapi::create_process {c:\katexie\wpa_supplicant.exe} -cmdline {-
i{2165EB16-49D0-A553-C0E6E25330D1} -copen.conf -d}
this time, the program can be found.
but the TCL think the argment is not correct. why?
thanks.
If you use exec with a & appended, exec will return the PID of the
created process which you can use with twapi::end_process to close the
application. For example:
set pid [exec c:/katexie/wpa_supplicant.exe -i{2165EB16-49D0-A553-
C0E6E25330D1} -copen.conf -d &]
and later
::twapi::end_process $pid
Mark
First of all, when reporting back issues, it is very useful to include
the exact error you are getting as Tcl generally has very instructive
error messages. Secondly, the TWAPI create_process manual at
http://twapi.sourceforge.net/process.html states:
This generally includes the program being executed as the first
token in CMDLINE.
So try:
twapi::create_process {} -cmdline {c:\katexie\wpa_supplicant.exe -
i{2165EB16-49D0-A553-C0E6E25330D1} -copen.conf -d}
instead. If the PROGRAM argument is {} the -cmdline parameter will be
used instead.
Mark