When Clementine is with you, she'll shoot it. If you don't take Clementine with you, you have three things you can do in that situation.
1: Shoot the walker
2: Don't shoot and she runs away to not be seen again
3: Shoot Molly and she's not seen again
So to answer your question, yes, you can shoot the walker in the hallway if you DON'T have Clementine with you.
"I'll miss you..."
And on that night, there were many tears to be shed, and many eyes to be gouged...
I'm pro Doug, I'm pro Ken, I saved your life, but f*ck you Ben