Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

TCL(Tool Command Language) Scripting

Problem abut twapi::creat_process


Dear all:
       I have create a tcl file to run a program wpa_supplicant.exe.
the script is as following:

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.

> Dear all:
>        I have create a tcl file to run a program wpa_supplicant.exe.

sorry, the command in DOS command window is:

On May 24, 5:26 am, x@163.com wrote:

> > Dear all:
> >        I have create a tcl file to run a program wpa_supplicant.exe.

> sorry, the command in DOS command window is:

> >          c:\katexie\wpa_supplicant.exe -i{2165EB16-49D0-A553-
> > C0E6E25330D1} -copen.conf -d- Hide quoted text -

>

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

On 5 24 ,   5 15 , Mark Janssen <mpc.jans@gmail.com> wrote:

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.

hi Mark,
      I use create_process not exec for I can control the program if I
want to stop it.
and if i use exec, tcl cann't stop the program.
On May 25, 4:18 am, x@163.com wrote:

> hi Mark,
>       I use create_process not exec for I can control the program if I
> want to stop it.
> and if i use exec, tcl cann't stop the program.

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

On May 25, 4:15 am, x@163.com wrote:

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

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc