I get that too, I think it’s got something to do with the fact there’s not much need for MS-DOS in modern games so Win XP gets funny about it, you could try the compatibility mode wizard but not sure if it would achieve the desired result.
To get the compatibility wizard, open up Help and Support and type a search for “compatibility modes”
Try this instead (exact same idea as WWR’s): Go to help and support, click on “music, video, games, and photos”, expand the “games” tab, click on “fixing a games problem.” Under “Fixing a games problem” click on “getting older programs to run on Windows XP”, you can read through the text but ultimately you’ll probably need to use the program compatibility wizard like people have said. I think you can just right click on the program it’s self and do this too under properties and then “compatibility.” The Sims isn’t’ all that old but try running it under Windows 2000 or '98 I guess.
Yeah, '98 will definatly work for The Sims, you might need to drop the resolution in the compatibility wizard before playing too if your monitor is set to a high res.