From the context of what you stated in your question, I presume that you and your "ex" have never been married, but do have children together. In this kind of situation, if you wish to have be awarded the sole physical and legal custody of your children, the only way to do that is to go through the courts and obtain an order of child custody. This does not mean that you and your ex must fight in court; if both of you agree to the terms of the child custody and support and visitation order, you can file what's called a stipulated petition with the court and ask the court to issue an order in conformity with the agreement you and your ex made. Otherwise, however, if your ex fights you over custody or child support, you will need to go to court and go through a trial to obtain a child custody order.
Answered on Dec 23rd, 2013 at 8:07 PM