Scanning a .cs file or a directory
In my opinion, the easiest way would be to embrace exceptions. DirectoryNotFoundException and FileNotFoundException are there for a reason, and actually even calling .Exists might not save you from them - the file might be moved/removed between the Exists and the action you're taking next.

You can do:

public static void ProcessPath(string path)
{
    var extension = Path.GetExtension(path);

    if(string.IsNullOrEmpty(extension))
    {
        Program.ScanDirectory(path);
    }
    else
    {
        if(extension != ".cs")
            throw new NotSupportedException("Only .cs files are supported");

        Program.ScanFile(path);
    }
}


And either catch those exceptions higher up and write them to console or (considering you're doing Environment.Exit in your example), just let them propagate and crash the application.