Use PATHEXT when checking for the presence of scripts on Windows.