The Emergency Command Hologram (ECH) was an extension of the USS Voyager's Emergency Medical Hologram, first imagined in one of The Doctor's fantasies. The program was eventually implemented by Captain Kathryn Janeway on Voyager. Essentially, the ECH was a 'backup captain', in the event of the current command crew being incapacitated. The ECH possessed information from all major Starfleet strategic and tactical databases and could incorporate them into its plans for controlling the ship.
The extension was first envisioned by The Doctor after he added a daydreaming subroutine to his program in 2376. His initial request to Captain Janeway was denied, but after The Doctor demonstrated his abilities in practice, Janeway reconsidered and ordered research into the development of the ECH. (VOY: "Tinker Tenor Doctor Spy")
Exactly when the ECH subroutines were completed and installed is unknown. However Janeway eventually activated The Doctor's command subroutines in 2377 when tetryon radiation forced everyone to abandon ship. Shortly after the ship was abandoned, Voyager was attacked by scavengers. He and the computer disabled one ship and evaded the others by hiding in a nebula. He managed to begin repairs, but when Commander Chakotay, Ensign Harry Kim, and Neelix returned from an away mission, life support was not yet online, though previously, as a hologram, this was not an immediate concern to The Doctor. (VOY: "Workforce")
After Chakotay and Neelix sought the rest of the crew, who had been abducted by the Quarren, Kim and The Doctor disagreed about who was superior to the other; Kim was a commissioned officer, but The Doctor had information about all of Starfleet's great strategists. In one battle with the Quarren, The Doctor called up information about a Romulan battle from his tactical database, leading him to use a photonic shockwave against the ships, before retreating. In the final battle against the Quarren Harry Kim's plan to sabotage three escape pods and detonate them once in the enemies' tractor beams saved Voyager. This provided a lesson to The Doctor about experience. He realized that he was needed on Voyager as a medic more than as a commander, and made peace with Kim before handing back command to a rescued Captain Janeway. (VOY: "Workforce, Part II")
A trial on the rights of The Doctor was initiated when his holonovel was published without his permission in 2378; the publisher arguing that The Doctor had no legal rights due to his status as a hologram, prompting the crew to arrange a hearing to determine The Doctor's rights as a sentient being. Harry Kim cited the ECH extension in The Doctor's favor, regarding it as a Human desire to develop and change. While the publisher argued that this simply showed that The Doctor's program could be altered, Harry countered that The Doctor's request for the creation of the ECH represented a desire to improve that would not have been expected of a hologram designed to do a specific task. (VOY: "Author, Author")
Later that year, The Doctor disguised himself as Commander Chakotay and used his command codes to transform himself into the ECH. As the ECH, The Doctor had authorization to eject the warp core, which he did. He then escaped from the ship aboard the Delta Flyer II with the warp core to exchange it with the Hierarchy for Captain Janeway's freedom. Both Janeway and the warp core were recovered and returned to Voyager, although The Doctor remained in sickbay for a week out of embarrassment about the "deathbed confessions" he had made while the excess subroutines installed by the Hierarchy were being deleted. (VOY: "Renaissance Man")