Skip to content

dos_search

Dale Fugier edited this page Jul 1, 2026 · 1 revision

Searches for a file in a specified path. The function searches for a matching file in the directories specified the path argument. If path is nil, the following directories are searched, in the order listed:

The directory from which the application loaded

The current directory

The Windows system directory

The Windows directory

Any directories listed by the PATH environment variable

Syntax

(dos_search filename [path])

Parameters

filespec

The source filename.

path

A formatted path to search (e.g. "C:\Windows;C:\Windows\System;...").

Returns

A qualified path to filename if successful.

nil if not successful, or on error.

Example

Command: (dos_search "kernel32.dll")
"C:\\WINNT\\System32\\kernel32.dll"

Command: (dos_search "3d.lsp" (getvar "acadprefix"))
"C:\\Program Files\\AutoCAD 2006\\support\\3d.lsp"

Clone this wiki locally