Restraining order / custody ?

Can you file for a restraining order before getting full custody of the child ?