Well it kind of is a real virus.. But not the kind you should be worried abt.
They're called Joke Viruses, and are usually used to make horror games more interestingly scary.
Like how Sonic.EXE games tend to close the window by itself, or change wallpapers and stuff.