Brian Baumgartner of "The Office" also will be part of the episode, which is set to air live on the East Coast at 10 p.m. Wednesday, June 19. West Coast viewers will see a taped version of the episode at 10 p.m. PDT.
Shatner, who's 82, joked that at long last he's working with someone older.
"Live TV is nothing new to the "Star Trek" star. He appeared in live television dramas of the 1950s and has been the host of NBC's "Saturday Night Live."
TV Land previously announced that five co-stars from "The Mary Tyler Moore Show" will be featured in a "Hot in Cleveland" episode during the second half of the fourth season. Mary Tyler Moore, Valerie Harper and Cloris Leachman will join "Hot in Cleveland" star Betty White, who plays Elka, and semi-regular Engel, who plays Elka's close friend, Mamie Sue.
Filmed in front of a live audience on stage 19 of CBS Studio Center in Studio City, Calif., the TV Land comedy stars sitcom veterans Bertinelli ("One Day at a Time"), Malick ("Just Shoot Me") and Leeves ("Frasier") as three best friends who move from Los Angeles to Cleveland. White, who also starred on NBC's "The Golden Girls,'' plays the cantankerous caretaker who goes with their Cleveland home.
Copyright 2013 The Associated Press.