Star Switch

A Star Switch is an object found in some levels of Super Mario 64 DS. They are yellow, star-shaped switches with an exclamation mark on them. Upon being pressed, a star will spawn somewhere in the level the Star Switch is found in for a limited amount of time until it is either collected or time runs out. If time runs out, the star will despawn until the switch is pressed again.

Super Mario 64 Manifestation
In some personalized copies of the original Super Mario 64, Star Switches can appear and function similarly or the same as their appearance in Super Mario 64 DS. Some people have reported the star doesn't despawn, likely due to limitations of the Personalization A.I.