In a hypothetical location in the cosmos with no gravitational or frictional influences, if you were to throw a rock, it would continue moving indefinitely in the direction you threw it, at the same speed you imparted to it.
According to Newton's first law of motion, an object in motion will stay in motion at a constant velocity unless acted upon by a net external force. Since you specified that there are no external forces (like gravity or friction), the rock would not slow down or change its trajectory. It would simply move straight away at a constant speed until it encounters another force or influence (which, in this case, could take an incredibly long time or never occur).