Short answer: The previous WinPE creation did not complete, and the old WIM image is still in use by the system, so the new image cannot be written or mounted, which triggers the error. This guide describes three solutions: restart the computer, use DISM to unmount the residual image, and use DISM to clean up the damaged mount.
Why Can't I Add a Boot Menu After the Update?
When Hasleo creates the WinPE boot environment, it uses the built-in Windows DISM (Deployment Image Servicing and Management) tool to mount the base WIM file to a temporary directory (usually C:\WinPETem\), and then injects drivers and program files into it. If this process is forcibly interrupted, the mounted image is not automatically unmounted and keeps the WIM file and the mount directory locked.
When you re-add the boot menu entry after updating the software, Hasleo needs to rebuild the WinPE image. However, the old image is still in the "mounted" state, so the new image cannot be written to the same location and the build fails with an error. In essence, a residual DISM mount session is blocking the new WinPE build process.
Preparation Before Repair
Before you begin, complete the following preparations to avoid interruptions during the operation:
- Save and close any files you are editing. The following steps may require a computer restart.
- Open Task Manager and close all Hasleo-related processes, such as BackupMainUI.exe, BackupService.exe, and BackupWorker.exe.
- Make sure that you have administrator privileges. The following commands must be run from an administrator command prompt.
- If third-party antivirus software is installed, temporarily disable real-time protection, and re-enable it after the operation is complete. (Some security software blocks writes to
C:\WinPETem\.)
Method 1: Restart the Computer
This is the simplest method. In many cases, restarting the computer releases the occupied image and clears the temporary state.
Method 2: Check for and Unmount the Residual WinPE Image
This is the most direct and safest repair method. It applies when Method 1 does not work.
dism /get-mountedwiminfo
C:\WinPETem\, skip Method 2 and proceed directly to Method 3.
If the output contains an entry whose mount path includes C:\WinPETem\, that entry is the residual WinPE mounted image.
dism /unmount-image /mountdir:"C:\WinPETem\636a3274-569a-4069-9974-21d04e3a88ce\mount" /discard
C:\WinPETem\636a3274-569a-4069-9974-21d04e3a88ce\mount with the actual path found in Step 3.
C:\WinPETem\ entry has disappeared, and then open Hasleo Backup Suite and add the boot menu again. The operation should now complete normally. If adding the boot menu still fails, continue with Method 3.
Method 3: Clean Up the Residual Mount State
/cleanup-wim is a dedicated repair parameter built into DISM. It deletes the mount resources associated with a damaged WIM image. When the unmount command in Method 2 fails, or when the C:\WinPETem\ directory is still locked but no valid entry remains in the DISM list, this solution can forcibly clean up the residual mount metadata and temporary files.
dism /cleanup-wim
Preventive Measures
To prevent this problem from happening again, follow these recommendations:
- Avoid interrupting the WinPE creation process: While Hasleo is creating the WinPE image, do not force-close the software or restart the computer. This process usually takes several minutes; please wait patiently for it to complete.
- Remove the old boot menu before updating: Before installing a new version, we recommend clicking Remove Boot Menu in the Tools menu of the old version, then adding it again after the update. The installer removes the boot menu item during the upgrade, but residual temporary files can still cause issues.
- Check the DISM mount status regularly: If you often perform system maintenance or use other tools that involve WIM files, you can occasionally run
dism /get-mountedwiminfoto check for images that were not unmounted properly. - Configure antivirus exclusions: If the problem recurs, add BackupMainUI.exe, BackupService.exe, and BackupWorker.exe to the antivirus exclusion list to prevent writes from being blocked.
Frequently Asked Questions (FAQ)
A: No. /discard only discards temporary changes made during the current WinPE image build process. It does not affect your existing backup files or backup task configurations.
A: No. /Cleanup-Wim cleans up corrupted mount associations and leftover resources recorded by DISM. It does not delete the original WIM files. Your Hasleo backup files and WinPE source files remain intact.
A: During the upgrade, Hasleo Backup Suite first uninstalls the old version, which removes the old boot menu entries. You therefore need to manually add them back after updating so that the boot menu points to the WinPE environment for the new version.
A: Yes. This folder is a temporary working directory created when Hasleo builds WinPE. It is normally cleaned up automatically after the process finishes. Deleting it manually will not affect the software or your existing backups.
Conclusion
This article addresses the typical problem of troubleshooting and fixing residual WinPE images and provides a three-level troubleshooting path, from simple to advanced:
- Solution 1 (restart the computer): Zero cost and worth trying first. It applies when the temporary state can be cleaned up automatically by the system.
- Solution 2 (use DISM to unmount the residual image): For ordinary residue that DISM can still identify as a mount session, use the standard
/Unmount-Image /Discardunmount. - Solution 3 (use DISM to clean up the damaged mount): For edge cases where the mount state is damaged and standard unmounting fails, use
/Cleanup-Wimto force cleanup and restart the computer.
These three solutions build on one another. After repairing the problem, take preventive measures to reduce the chance of it happening again at the source.