How long can communicable diseases exist outside a host?

How long can a communicable disease exist outside a host without special measures taken to preserve it?

Let’s say you have a hospital room crammed with patients who have dysentery, cholera, tuberculosis, pneumonia, Marburg virus, mumps, and the flu. They’re expelling any number of bodily fluids in all directions. After you take them out, how long before one could lick the floors and walls of the room and have a zero chance of contracting any of their diseases?

Does this depend on the humidity and how long the blood, sputum, etc. is still wet? If so, how long after the fluids dry will the infectious agents be deactivated?

For the purposes of this OP, I’m more interested in diseases that can spread person-to-person and not stuff like anthrax or vector-borne diseases.

Depends on the disease(s) in question. For instance, hepatitis A could live on surfaces (under favorable conditions) for months. HIV, on the other hand, is very fragile and all or almost all of the virus dies when the bodily fluid containing it dries up.

It completely depends on the type of pathogen. Some bacteria form incredibly long-lasting spores that can also survive all sorts of extreme conditions. Several species of Clostridium or Bacillus have pathogenic spores, particularly C. difficile (some strains of which cause a nasty GI infection) and C. tetani (which causes tetanus). Ingesting C. difficile spores is a good way to infect yourself. These sorts of spores can easily last for years.

And at the other end of the spectrum, there are some viruses that are so sensitive to the external environment that they can only be transmitted by direct exchange of body fluids – HIV for example.

As note above

Back during one of the anthrax scares the Elko Nevada paper reported that utilities had dug up a cow that, based upon branding information, had been buried over a hundred years previously and the spores were determined to be still viable. The anthrax was not the strain used in terrorism.