Here's a simple oneliner that's mainly intended for maintenance of Windows, (because the problem is typical for Windows, hence the type of quotes), to detect what leftover cruft your PATH environment variable contains from old installations that have since then been removed from your system.
It'll simply list all directories in PATH that do not (any more) exist.
perl -MFile::Spec -le "print for grep !-d, File::Spec->path"