With my son's Toshiba, running Vista, we had created the restore DVDs when new. When the hard drive died I simply replaced it and used the recovery DVDs to reinstall as new. Everything was as factory set and we could even create the recovery discs again. Hope that helps.
OnePlus 5T review: Hands-on