With Windows, there is no such thing as 'identical systems', alas.
Because of its age GW-BASIC has some difficulties handling the hardware/software changes that have occurred beneath it. XP's DOS emulator is actually rather weak, and is known to goof in weird spots.
A good spot to start when dealing with Windows directly is this page:
Running GW-BASIC under Windows. (The whole site is actually pretty good.) The recommendation is to have your GW-BASIC programs set up to start by turning
off as much as the new-fangled Windows stuff as possible, and open directly in a full-screen mode. (Of course,
Vista will not play fair no matter what you do to the Windows environment.)
There is also a known bug with
Compaq systems that needs to be patched. (But I don't know if this applies --it has been years since I have had to mess with a Compaq PC.)
Enable Compaq PCs to Run QBASIC Programs
The other option is to run it under a
good DOS emulator. (That is,
not the one that comes with Windows.) I recommend
DOSBox. There are others.
Good luck!