I have a really old laptop and the HDD is about to fall completely. My friend gave me an old laptop which don't work (but the HDD is completely functional) to me to salvage parts to fix mine. I want to know how can I come the contents of my HDD to the one in my friends computer in a way that doesn't mess with the installed OS (Windows 10).
Open laptop, take out the HDD, connect HDD to some other computer, for example your friend's computer. Connect new HDD to same computer.
If possible under Windows, make sure Windows doesn't mount the hard disk (because that may cause writes). Use some program to copy the hard disk block by block, Google for which programs you can use. (Under Linux/MacOS,
dd is sufficient).