Smarter command prompt execution