MSDN, CreateProcess:
...If the filename does not contain a directory path, the system
searches
for the executable file in the following sequence:
- The directory from which the application loaded.
- The current directory for the parent process.
- Windows 95 and Windows 98: The Windows system directory.
Use theGetSystemDirectory function to get the path of this directory.
- Windows NT: The 32-bit Windows system directory.
Use the GetSystemDirectory function to get the path of this
directory.
The name of this directory is SYSTEM32.
- Windows NT: The 16-bit Windows system directory.
There is no Win32 function that obtains the path of this directory,
but it is searched. The name of this directory is SYSTEM.
- The Windows directory. Use theGetWindowsDirectory function to get the
path of this directory.
- The directories that are listed in the PATH environment variable.
erm, yes, that's it!
cheers
Simon
···
-----Original Message-----
From: Ara.T.Howard [mailto:Ara.T.Howard@noaa.gov]
Sent: Tuesday, September 13, 2005 3:38 PM
To: ruby-talk ML
Subject: find executables on windowsin linux i'd do something (un-tested) like:
def find_bin bin
bin = nil
path = ENV['PATH'].split File::PATH_SEPARATOR
path.each do |dir|
b = File::join dir, bin
return b if File::executable? b
end
bin
endwhat would the equivalient be in windows? should the above
work or do i need
to check some other env vars?cheers.
-a