Is there a function which takes a filename and searches the local hard drive and returns the full pathname to the file ?

Also, is there a function which examines the current running .exe and returns the pathname.

On NT, when I record declarations , the wizard automatically sets a variable called sDir = "c:\program files\myapp.exe"

But this path will be different on Unix , so I was wondering if I could do it on the fly.