def win_find_exe(filename, installsubdir=None, env="ProgramFiles"):
    """Find executable in current dir, system path or given ProgramFiles subdir"""
    for fn in [filename, filename+".exe"]:
        try:
            if installsubdir is None:
                path = _where(fn)
            else:
                path = _where(fn, dirs=[os.path.join(os.environ[env], installsubdir)])
        except __HOLE__:
            path = filename
        else:
            break        
    return path
dataset/ETHPy150Open phaethon/scapy/scapy/arch/windows/__init__.py/win_find_exe