Some TMNT stuff really isn't for little kids.
During a battle with the Turtles and Splinter, Shredder, his enemies and a number of Foot ninja were transported to a different dimension, in the city of Gotham. To return to his own dimension, Shredder kidnapped Dr. Naveen Khan and sending out his ninja to steal important technology that could be used to create a dimensional portal. The Turtles attempted to thwart these thefts, with no success.
The thefts also attracted the attention of Batman, whom the Shredder warned away from the Foot Clan. Shortly afterwards, Batman joined forces with the Turtles and attacked Shredder's laboratory, freeing Dr. Khan. However, Shredder was prepared for their attempt to return to their own world, and killed Dr. Khan even as he blew up the portal, knowing that the Turtles and Splinter would revert to unmutated animals soon.
He departed in a helicopter, and found Ra's al Ghul waiting for him inside. Ra's al Ghul proposed a partnership, which Shredder agreed to. The League of Shadows scientists were able to identify a transmission from Shredder's home dimension, which turned out to be Casey Jones, who was carrying several canisters of mutagen for his friends.
Ra's al Ghul and Shredder took the canisters and headed for Arkham Asylum, where they mutated the various dangerous criminals imprisoned there. Batman's attempts to attack Shredder were thwarted by the mutants, and Shredder decided that Batman was unworthy of being personally killed by him. Just as he was about to engage the police forces outside, the Turtles appeared and began fighting the Arkham inmates as well as Ra's al Ghul.
Once freed, Batman fought with Shredder, tearing off his gauntlets and knocking the helmet from his head. Ra's al Ghul abandoned him, and Shredder was left unconscious on the floor, to be tossed through a portal back to his own world.
Once there, he was arrested and imprisoned in a high-security cell on Rikers Island. In his absence, the Foot Clan fractured, and then reunited behind the criminal Bane. Batman fought his way into Shredder's cell with his armor and clothing, in the hopes that the Foot's loyalty to him would sway them away from Bane. Shredder agreed, on the condition that Batman fought him again. They fought, and Shredder lost.
Shredder then accompanied Batman and Splinter to the Statue of Liberty, where the three fought Bane personally. He then appeared before the assembled Foot Clan and ordered them to follow Karai instead. When Bane was finally defeated, Shredder willingly returned to his prison cell.