From: Dave Burt Date: 2005-09-13T22:51:32+09:00 Subject: Re: find executables on windows Ara.T.Howard asked... > > in 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 > end > > what would the equivalient be in windows? should the above work or do i > need > to check some other env vars? That's the only env var. There's no executable flag, though, and I don't know what File::executable? does on Windows. I'd try exist? - and you'll need to append the suffixes in ENV['PATHEXT']. (.com, .exe, .bat, .cmd, maybe more like .js and .rb) Cheers, Dave