# which(program)

Determines the location of an executable in the system path.

### Syntax

o_which(program)
  program: Text - the name of the executable
  return: Text - the full path to the first executable found that matches the specified name

### Usage

Use this to find an executable which is in the system path. Executables not found in the path are not reported.

### Location

menu: veeos ==> Scripting ==> Script-Based Functions ==> Which

library: scriptLib

### Example

The typical usage of which occurs when the user has several executables in their path and wants to determine which one gets used. For example there may be several versions of Python installed. When the user executes "python" via Execute Program Python runs fine but it may be unclear which version runs.

`o_which("python.exe")` returns `C:\apps\python3.8\python.exe`

### Notes

Under the assumption that it is likely an oversight, the typical ".exe" suffix is automatically appended if it is not specified. As such if you are looking for an executable without the ".exe" suffix, o_which() may return something other than what you are looking for

### Reference

### Dependencies

This function is implemented with a Python script called via scriptPro.

### Supported On

VEE 7.0+, Windows 7+

### See Also

findFile

© 2015-2021. All Rights Reserved. Stan Bischof (stan@worldbadminton.com). Last updated 09 August 2021 18:32.