Williams' next feature "RocketMan" would mark his starring debut, playing a scatterbrained scientist who ends up on the first manned mission to Mars, much to the chagrin of his captain (William Sadler). A slapstick vehicle complete with requisite off-color jokes and sight gags, "RocketMan" was popular with a mostly younger audience, and helped to launch Williams' career. While he returned to smaller character roles in films as varied as "Wag the Dog" (1997), "Half-Baked" (1998) and the Bruce McCulloch-directed "Dog Park" (1999), he was given more opportunities on the small screen, starring as a man masquerading as a woman in order to secure a job in the "Mrs. Doubtfire" and "Tootsie"-inspired ABC/Disney TV-movie "Mr. Headmistress" (1997). Williams teamed up with "Kids in the Hall" cast member McCulloch again, playing Mary Katherine Gallagher's devoted love interest in the 1999 feature "Superstar," and was showcased to good effect in the comedy "The Whole Nine Yards" (2000), performing in his first nude scene.Williams was busy back on the small screen in 2000, voicing a character on the short-lived David Spade animated NBC series "Sammy," and playing a nice guy who turns into a pompous jerk in a bid to further his faltering career in the TV-movie "Becoming Dick" (E! Entertainment Television). The comedian hosted the Comedy Central stand-up series "Premium Blend" beginning in 2000, his absurdist two-minute introductions winning over an audience less inclined to enjoy his work at full throttle. He added some wackiness to the standard sitcom format as co-star of the ABC sitcom "The Geena Davis Show" (2000-01) and voiced the carefree roadtripper Mike Bonner on the UPN Claymation midseason replacement series "Gary & Mike" (2000-01). While busy on television, Williams continued to do film work, and completed a starring role in the romantic comedy "Lucky 13" (2005) and was Tom Green's affably abused sidekick in the Canadian TV host and shock comic's directorial debut "Freddy Got Fingered" (2001). He maintained a steady schedule, including a lead role in the ill-fated "Sorority Boys" (2002), an inane and widely panned comedy about three college boys who pledge a sorority in order to stay on campus that summarily flopped at the box office. After portraying the owner of a video arcade in the straight-to-video release "Kart Racer" (2004), Williams was the voice of Lug in "Robots" (2005), a well-reviewed animated feature about a world entirely inhabited by mechanical beings.Williams continued the robot trend for his next film, "Meet the Robinsons" (2006), supplying voice of Carl, a feisty robot owned by the futuristic Robinson family who try to help a young boy genius (Jordan Fry) return to his own time after the evil Bowler Hat Guy (Stephen John Anderson) steals his means of getting back home. In the live action world, Williams played the bumbling Sheriff Rosco P. Coltrane in "The Dukes of Hazzard: The Beginning" (ABC Family Channel, 2007), a prequel to the 2005 theatrical release that found Bo (Jonathan Bennett) and Luke (Randy Wayne) sentenced to a summer of hard work on Uncle Jesse's (Willie Nelson) farm, which is under the threat of foreclosure by Boss Hogg (Christopher McDonald).