If it's the copy of Windows that came with the laptop then the answer is no. These are generally OEM licenses and they are not legally transferable. Also if it's Windows 7 or older it will not run on newer hardware since there isn't driver support typically.