@echo off set IMAGE=%SystemDrive%\TEMP\IMAGE set BOOT=%SystemDrive%\TEMP\BOOT echo unmounting image and discarding changes ... dism /Unmount-Wim /MountDir:%IMAGE% /Discard echo. echo unmounting boot and discarding changes ... dism /Unmount-Wim /MountDir:%BOOT% /Discard echo cleaning up ... dism /Cleanup-Wim dism /Cleanup-Mountpoints echo showing status ... dism /Get-MountedWimInfo