Mr Justice Peter Smith threw out the charge and said the fact it had been made was an abuse of the process.
King had been accused of committing contempt for allegedly breaching a gagging order relating to a deal with retail tycoon Ashley.
But Smith said the charge had been "designed to intimidate rather than seek a proper sanction for an alleged breach".
The Newcastle United owner believes King had broken a confidentiality agreement by discussing the terms of a retail agreement with Sports Direct in a Sky Sports interview.
Ashley owns nine per cent of the Scotttish club - making him the second largest single shareholder - but owns 75 per cent of the club's retail operations through Sports Direct.
Rangers shareholders have voted to renegotiate the deal "on a basis that is fair and reasonable for both parties and will deliver best value to both club and Sports Direct".
Friday's High Court ruling marks the latest development in an ongoing bitter pursuit between Sports Direct and Rangers since a consortium led by King usurped Ashley's associates on the club board last March.
King told shareholders last year that the constant legal wranglings were harming the financially-hampered club's rehabilitation.
"There is a desire to drag Rangers through the courts and thereby slow our progress rather than seek compromise or fairness," said the South African businessman in November.