Winbootmate Full — __link__
def fix_boot_errors(self): self.log("\n--- Attempting common boot fixes ---") self.run_admin_cmd("bootrec /fixmbr", "Fix MBR") self.run_admin_cmd("bootrec /fixboot", "Fix boot sector") self.run_admin_cmd("bootrec /scanos", "Scan for OS") self.run_admin_cmd("bootrec /rebuildbcd", "Rebuild BCD") self.log("Reboot to see if issues are resolved.")
# 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) winbootmate full
def create_bootable_usb(self): iso_path = filedialog.askopenfilename(title="Select Windows ISO", filetypes=[("ISO files", "*.iso")]) if not iso_path: return # Get USB drive letter drives = [] for d in ['D:', 'E:', 'F:', 'G:', 'H:', 'I:']: if os.path.exists(d): drives.append(d) if not drives: self.log("No removable drives found.") return def fix_boot_errors(self): self
self.log("Extracting ISO to USB (this may take a while)...") # Mount ISO mount_result = subprocess.run(f'powershell Mount-DiskImage -ImagePath "{iso_path}" -PassThru', capture_output=True, text=True) if mount_result.returncode != 0: self.log("Failed to mount ISO. Try using Rufus or Ventoy.") return # Get mounted drive letter mount_letter = None for line in mount_result.stdout.splitlines(): if ":" in line and "\\" in line: # crude extraction parts = line.split() for p in parts: if len(p) == 2 and p[1] == ':': mount_letter = p break if not mount_letter: self.log("Could not find mounted ISO drive.") return "Fix MBR") self.run_admin_cmd("bootrec /fixboot"