A novel constraint-following control for uncertain mechanical systems is proposed. In mechanical systems, certain given forces may arise due to the constraint forces, which means the given forces are coupled with the constraint forces. By using the second-order form of the constraints, the given forces are decoupled explicitly. The uncertainty of the mechanical system is time-varying and bounded. But its bound is unknown. A series of adaptive parameters are invoked to estimate the bound information of the uncertainty in virtue of state feedback. Based on the estimated bound information, a robust control is designed to render the mechanical system an approximate constraint-following. The system performance under the control is guaranteed as uniform boundedness and uniform ultimate boundedness.