Winbootmate 'link' Full May 2026
def backup_bcd(self): backup_path = filedialog.asksaveasfilename(defaultextension=".bcd", filetypes=[("BCD files", "*.bcd")]) if backup_path: self.log(f"\n--- Backing up BCD to {backup_path} ---") # BCD store location (UEFI typically) bcd_path = r"C:\Boot\BCD" if not os.path.exists(bcd_path): bcd_path = r"C:\EFI\Microsoft\Boot\BCD" try: shutil.copy2(bcd_path, backup_path) self.log(f"✓ Backup saved to {backup_path}") except Exception as e: self.log(f"✗ Backup failed: {e}")
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}") winbootmate full
usb_drive = tk.simpledialog.askstring("USB Drive", f"Enter USB drive letter (e.g., E:)\nDetected: {drives}") if not usb_drive: return def backup_bcd(self): backup_path = filedialog
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) Create Bootable USB", command=self
def run_admin_cmd(self, command, description=""): """Run a shell command that may need admin rights.""" try: self.log(f">>> {description or command}") result = subprocess.run(command, shell=True, capture_output=True, text=True) if result.returncode == 0: self.log("✓ Success") self.log(result.stdout) else: self.log("✗ Failed") self.log(result.stderr) return result except Exception as e: self.log(f"Error: {e}") return None
# Output area self.output = scrolledtext.ScrolledText(root, wrap=tk.WORD, height=20, font=("Consolas", 9)) self.output.pack(fill=tk.BOTH, expand=True, padx=10, pady=10)