Standard compact scheme and upwinding compact scheme have high order accuracy and high resolution, but cannot capture the shock which is a discontinuity. This work developed a modified upwinding compact scheme which uses an effective shock detector to block compact scheme to cross the shock and a control function to mix the flux with WENO scheme near the shock. The new scheme makes the original compact scheme able to capture the shock sharply and, more importantly, keep high order accuracy and high resolution in the smooth area which is particularly important for shock boundary layer and shock acoustic interactions. Numerical results show the scheme is successful for 2-D Euler and 2-D Navier-Stokes solvers. The examples include 2-D incident shock, 2-D incident shock and boundary layer interaction. The scheme is robust, which does not involve case related parameters.