The legal term for a court order prohibiting a party from doing something is an injunction.
An injunction is an equitable remedy directing a person, company, or government body to stop specified conduct. Courts may issue a temporary restraining order or preliminary injunction while a case is pending, then decide whether a permanent injunction is appropriate after considering the merits and likely harm.
Injunctions are not limited to business disputes. They can address property conflicts, intellectual-property infringement, harassment, environmental damage, employment restrictions, and government action. A prohibitory injunction preserves the status quo by stopping conduct; a mandatory injunction instead requires a party to take a specified action.
A subpoena is different because it compels testimony or production of records. A writ of attachment concerns seizure or control of property, while contempt is generally a consequence for violating a court order rather than the order itself. Violating an injunction can, however, lead to a contempt finding.