Harry had noticed pretty fast that his cloak hid him from all forms of magical detection, including barriers and wards. Dobby had managed to get him the sword of Gryffindor from the headmaster's office, once again proving that wizards simply underestimated house elves severely. Although according to Dobby, the only reason he could do that was that Dumbledore had long allowed him access, and the sword belonged to the "great Harry Potter sir'. With the sword in hand, Harry had an easy time destroying all the Horcruxes he found. It took him nearly three weeks, with the elf's help to locate the Diadem of Ravenclaw and subsequently sneak into the Room of Requirements unnoticed. Two months of tracking to acquire the Locket of Slytherin and six weeks to find the Cup of Hufflepuff and figure out how to sneak into Gringotts undetected.