Highest rank at which someone would still be a military pilot

I work in a USAF Major Command (AMC). The 4-star MAJCOM Commander position is a flying billet. He can fly in any aircraft type in the command, but always with an instructor pilot. Same goes for the MAJCOM Director of Operations, a 1-/2-star flying billet, but always with an IP. Several divisions in the MAJCOM also have one or more flying billets (O-3 to O-6): Aircrew Stan/Eval, Aircrew Training, Tactics, Test & Evaluation, etc.

As a C-130 Squadron Commander (O-5), I only flew a couple times a month. However flying training hours were tight then, and I had many young pilots in the squadron that needed the flight time more than I did (I was very experienced in the plane).

Coming back to the OP’s question, it really depends on what OP considers “a flying military pilot”.

A flying billet that can get an officer into the cockpit of a military aircraft for qualification, refresher, cross-country transit, training, etc. (i.e., peacetime flying)… any rank, up to 4-star general.

Flying a combat mission? In the current US military, I’d be surprised if anyone with a star on a shoulder does it. O-6s may, it seems.

Right, combat was what I had in mind with the question. Not a 4-star general flying a few times a year over Nevada in peacetime.

A little tangential to the question, and I’m sure most people here know this already, but the abilities needed to fly in combat degrade significantly with age, and since rank is correlated with age, even though general or even colonel So-and-so may have the certifications and permission to fly in combat, it might not be a good idea.

Maybe someone knows a better cite for this, but here’s part of the summary of a Navy study of pilots’ vision and reaction times:

I have a navigator friend who’s an Air Natl. Guard lieutenant colonel (now retired) and kept flying as a navigator in KC-135 tankers for several years after making that rank.

Here’s a Wiki chart on officer pay grades in the U.S. military: Uniformed services pay grades of the United States - Wikipedia

If this were Star Trek, he would have taken a doctor with him.