Winbootmate: Full ((full))

# Copy files try: subprocess.run(f'xcopy {mount_letter}\\* {usb_drive}\\ /E /H /Y', shell=True, check=True) self.log("Files copied. Making bootable...") # Make bootable boot_sect_path = os.path.join(os.environ['WINDIR'], 'System32', 'bootsect.exe') if os.path.exists(boot_sect_path): subprocess.run(f'{boot_sect_path} /nt60 {usb_drive}', shell=True) self.log(f"✓ Bootable USB created on {usb_drive}") except Exception as e: self.log(f"✗ Copy failed: {e}") finally: subprocess.run(f'powershell Dismount-DiskImage -ImagePath "{iso_path}"', shell=True)

tk.Button(btn_frame, text="4. Create Bootable USB", command=self.create_bootable_usb, width=20).grid(row=1, column=0, padx=5, pady=5) tk.Button(btn_frame, text="5. Fix Boot Errors", command=self.fix_boot_errors, width=20).grid(row=1, column=1, padx=5, pady=5) tk.Button(btn_frame, text="6. Rebuild BCD", command=self.rebuild_bcd, width=20).grid(row=1, column=2, padx=5, pady=5) winbootmate full

class WinBootMate: def (self, root): self.root = root self.root.title("WinBootMate - Boot Assistant") self.root.geometry("700x550") self.root.resizable(True, True) # Copy files try: subprocess

def view_boot_entries(self): self.log("\n--- Current Boot Entries ---") self.run_admin_cmd("bcdedit /enum", "Enumerating BCD store") Fix Boot Errors", command=self

def restore_bcd(self): backup_path = filedialog.askopenfilename(filetypes=[("BCD files", "*.bcd")]) if backup_path: self.log(f"\n--- Restoring BCD from {backup_path} ---") target = r"C:\Boot\BCD" if not os.path.exists(os.path.dirname(target)): target = r"C:\EFI\Microsoft\Boot\BCD" try: # Need to take ownership/disable protection? Just copy with admin subprocess.run(f'copy /Y "{backup_path}" "{target}"', shell=True, check=True) self.log("✓ Restore successful. Reboot to apply.") except Exception as e: self.log(f"✗ Restore failed: {e}")

# Use diskpart + bootsect (common method) with tempfile.NamedTemporaryFile(mode='w', suffix='.txt', delete=False) as dp_script: dp_script.write(f"select volume {usb_drive[0]}\nclean\ncreate partition primary\nactive\nformat fs=ntfs quick\nassign letter={usb_drive[0]}\nexit\n") dp_script_path = dp_script.name