Well, there are some ways.
[edit: many people keep an old machine just for XP. That's probably the best way, but eventually it's gonna break.]
First, if they're 32-bit software, there's an excellent chance that they will run fine in 7 and 10 (64-bit). Main issues may be making sure any necessary support libraries (if any) exist - like old (2) version of .Net, DirectX9 (both of which are available in W10 but normally turned off - check the link for Windows Features in the Apps settings; in 7, you simply have to install the latest versions of them from the MS library). Some, unfortunately, like MSTS, have problems due to being actually written for Win98 so they assumed no effective security on Program Files - consider the MSTS trick of installing in their own directory at the C: root. I have a C:\oldegamez directory where several of them live.
If they're 16-bit software, note that ANY Windows 32-bit version includes the NTDVM (DOS Virtual Machine - which isn't really a VM but works sort of like one). Yes, that includes Windows 10. 32-bit Windows 10 is limited to 2GB RAM (can push to 3GB with some startup tweaks), is a bit hard to find, and usually comes only with things like tablets that are limited to 2GB of RAM and a small amount of storage, but if you find it or convince MS to sell you a copy you can use essentially any DOS, Win3, Win95/98, or XP software with it directly. Again, support package(s) might be needed. I've verified that by installing Train Dispatcher 2 in a little pink junk tablet with Win10 Home 32-bit; works fine.
Other options:
- Windows 7 only: XP Mode. This is a full copy of XP Pro 32 bit that runs in Virtual PC. Has full access to the host filesystem, so you don't actually have to install everything on a virtual hard disk. With some hacking (i.e. it's technically not legal) it's possible to get XP Mode to run in other VM managers, such as VMWare Player and VirtualBox. Free for use with Win7, but the license prohibits its use under any other circumstances.
- VirtualBox: if you have original (retail or unused OEM) media for XP, you can install and activate it in VirtualBox. Caveat though: graphics. VB and other VM managers don't have good graphics support, so something like MSTS or a flight simulator won't work - they demand "hardware acceleration" which the VM system doesn't provide a decent emulation of. You can install almost anything in a VM: I have Win98SE working well, with all the official and unofficial patches and the SciTech video driver (provides a sort of hardware accel emulation that lets some games - but not MSTS - work). Free for personal use (base VB is open source, but Extensions package is not and is needed for XP and up).
- DOSBox: this is a software-only virtual machine (VirtualBox and others use Intel hardware support) that emulates a variety of older CPUs including wait states and other things that prevent, for instance, the "divide by zero" error that's common when running very old software on modern CPUs. It includes a DOS clone. I have Railroad Tycoon (original) running like a champ in a DOSBox instance, as well as a full copy of Windows 3.1 (runs Train Dispatcher 2). Probably, you could install Win95 or 98, but I haven't tried. DOSBox can mount any directory in the host as a DOS disk - go for it. Open Source/free.
- Archive.org or Steam: some old DOS and Windows games are available in Archive.org or Steam, usually running in a customized DOSBox instance, sometimes the javascript version that runs in you browser. Free at archive.org, usually not free at Steam.
And if you really are into hacking, Wine in Linux can be set up to run 16- and 32-bit Windows software. You're on your own with that...
[edit: practically everything released for XP is a 32-bit executable; most stuff released for Windows 98 and later is 32-bit as well, but rarely with a 16-bit installer; Windows 95 stuff is a mixed bag; and practically all Win3.1 and DOS software is 16-bit.]
Happy hacking!
