extname returns ".exe", so this is just using cmd always.

I tested that spawn executes .bat / .cmd files so long as you use the full path to them.

Could you add in a comment saying why we'd want to go through cmd anyways (it fixes the arg parsing?)