Re: exec: Search order under Windows

From: Stefan Finzel (Stefan.G.R.Finzel_at_T-Online.de)
Date: 03/29/05


Date: Tue, 29 Mar 2005 21:33:50 +0200

Hi,

there is no simple way, but you should use auto_exec*** to locate a
command first. As this is a script you surely can adopt it to your
needs. Use "info body auto_exex***" to get the implementation.

Stefan

Jan Harnisch wrote:
> Hi all,
>
> when I call a external executable via the exec command under Windows,
> exec does not simply follow the order in the PATH variable, but first
> searches for the executable in other directories, e.g. the Windows
> system directory [1].
> Is there any simple and recommended way to change this behaviour, so
> that Tcl first searches in the directories listed in PATH?
> Greetings & TIA,
>
> Jan
>
>
> [1] as documented in the exec manpage:
> When attempting to execute an application, exec first searches for the
> name as it was specified. Then, in order, .com, .exe, and .bat are
> appended to the end of the specified name and it searches for the longer
> name. If a directory name was not specified as part of the application
> name, the following directories are automatically searched in order when
> attempting to locate the application:
> The directory from which the Tcl executable was loaded.
> The current directory.
> The Windows 9x system directory.
> The Windows 9x home directory.
> The directories listed in the path.
>
>


Quantcast