Guy Magnuson, 61, of 301 Westwood Road, Stamford, was charged with second-degree harassment and first-degree trespass by police Thursday.
The man repeatedly texted a hospital employee so much earlier in the week that security posted a photograph of him in the hospital, warning employees of a potential threat, police said. The hospital also notified police about the man Wednesday.
Hospital security also told the man to stay away from the hospital.
The man showed up in the hospital parking lot just before 1 p.m. Thursday and once again repeatedly texted the employee, police said. In one of the texts to the employee, the man threatened to attack a doctor with the baseball bat.
Police were called and the man was arrested at his home after two p.m.
Magnuson was released on a promise to appear in state Superior Court in Stamford.
Click here to follow Daily Voice Stamford and receive free news updates.