TCL: how to execute program using enviorment PATH variable -


I have found the following line in my script

exec $ :: env (PATH) / program .exe

In my env path variable, I found a directory where I found this executable file. For example: PATH env variable found among other - D: \ my_program \ bin

I have an error:

Error:

  couldn C: \ WINDOWS \ system32; C: \ WINDOWS; C: \ WINDOWS \ System32 \ Wbem; D: \ my_program \ bin; Program ": Do not execute any such file or directory  

Any suggestions on how to make the .exe file using system variables in PATH in TCL?

< P> Thanks

PS OK, when I have created a new ANV variable (PATH1) - without any other path, just a) and set the .exe file path, it seems to work Is PATH (with multiple paths) set to any solution set except D: \ my_program \ bin first?

You should use the Tcl Library function created for this auto_execok .

Try it:

  exec {*} [auto_execok program.exe]  

This automatically searches the path and uses it for exec Creates the correct path.

For example, to start Notepad.exe:

 % auto_e Xecok notepad.exe C: /windows/system32/notepad.exe % Exec {*} [auto_execok notepad.exe]  

To see why {*} is required, take a look. In fact, auto_execok is quite smart and can return the list if necessary, e.g. To run start to run on windows, which requires exec to work properly with the extension.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -