The consensus is that a new battery will not solve the issue. This is probably true, but this is an electronic device and a flaky battery MIGHT cause issues. What a new battery does is remove one possible cause from the equation. You've done just about everything else
There is one thing you haven't tried: a clean install.
So here's a suggestion that will remove that from the equation. You have that new drive that you tried (or succeeded) to install Windows 7. I suggest that you install a fresh Windows 8.1 on that drive.
Download the Windows 8.1 ISO by following OPTION ONE in:
Windows 8 and Windows 8.1 ISO - Download or Create
Burn the ISO to a DVD using the Media Creation Tool. You can also navigate to the download location and right click on the ISO, then select Burn disc image
, you don't need any other media creation software to make a bootable DVD from the ISO.
I strongly recommend using a DVD (I've tested that process).
Save your wireless driver to a flash drive, you can download the driver from HP
:note: this is only req'd if you can't connect to the Internet using Ethernet. A hard wired connection is preferred - it's quicker and there should be base drivers installed.
Remove/disconnect all external devices except the Mouse, KB, and Monitor
Have ONLY the new drive in the machine
Boot from the Windows 8.1 DVD you just made
Install Windows 8.1 - enter the product key you already have when prompted
Connect to the Internet and run Windows Update manually to get WHQL drivers for every device Windows knows about. Check the Optional updates for drivers and select all of the ones offered.
When Windows Updates doesn't offer any more updates, check Device Manager for any warnings or errors.
Try to update the driver from inside Device Manager - if no new driver is found, post a screen shot of Device Manager showing the trouble devices. The HP page for your machine (dv7-1245dx) is probably out-of-date - I can search HP for the latest and greatest (not always easy). The most problematic on my machine are the AMD chipset (bus, USB 3.0, and something else) and the wireless (half card BT and 802.11). I'm pretty sure though that Win8.1 gets most of the drivers (even the fingerprint reader which was another problematic driver to find).
Use this tutorial as a guide:
Pay close attention to step 7 and step 8 - this will give you the best disk schema. The yellow Tip box under Step 8 describes Drive Options (Advanced). Since this is a new HDD, you want the entire drive UNALLOCATED as shown in the image under Step 8.
If you have any questions - ask first. It's easier to answer a question than start over
Drive options (advanced)
If you have more than one partition for a disk # (hard drive) listed and want to get rid of all of them to make that disk # one single partition drive again, then select a partition with that disk # and click on the Delete option for each partition with the same disk # until there is only one "unallocated space" with that disk # left as in the screenshot below.