Winre wim what kind of file. Using the CheckHealth option in DISM

To replicate a standard configuration on several computers, it is rational to use an image of a once installed operating system.

Detailed instructions are available on the Microsoft website: Creating and using Windows images

Since with a large set of additional software, the partition image file can easily exceed 4GB, it will not be possible to burn such a distribution onto a DVD disc. However, this is not required to install the OS. It will be enough for us to obtain an image of the partition on which the OS is installed. Then it can be included in the distribution on a bootable Flash disk or simply transferred to a new computer by booting from any live-CD/DVD/USB. In this article we will look at both options.

Having prepared the partition once, we will be able to deploy a working OS with all installed software, connected peripheral devices and necessary shortcuts on new computers in less than half an hour.

According to Microsoft: "When creating an image, be aware that the partition layout on the source and destination computers must be identical. For example, if the Windows image is stored on drive D, you must also deploy this image to drive D of the destination computer, and the following partition settings must also match ():

  1. Partition types (primary, secondary or logical) must match
  2. If a partition is made active on the reference computer, it must also be active on the target computer."

However, if we add a prepared partition to the distribution, then these restrictions do not matter.

Step-by-step instructions for deploying Windows 7 from an image

1. We do a template installation of Windows in audit mode

5. Write the created partition image to the local hard drive

E:\tools\imagex.exe /apply E:\images\win7image.wim 1 C: WITH:- the section where we will deploy the image 1 - number (or name) of the image, default = 1

If the OS images are located on a network resource, then connect it first with the command:

Net use E: \\server\share /user: domain_name\username password

6. Completion

If you created a separate system partition, then you need to transfer boot system files to it (we assume that the OS is located on the C: drive):

Bcdboot C:\Windows

Exit Windows PE:

or close the Windows 7 installer window. The computer will reboot. We take out the CD/DVD disk and boot from the newly installed OS.

7. Complications

  • If you encounter problems loading the transferred OS, you can try restoring the bootloader. To do this, you need to boot from the Windows 7 distribution (you can open the console by pressing Shift+F10) or Windows PE and run the command:
bcdboot C:\Windows /l ru-RU /s C: Read more in the article "Restoring the Windows and Linux bootloader".

Repository of various Windows images

You can create several images of partitions with different sets of software using the same template OS, then place them in one place, for example on a flash drive, and each time install exactly the image that will be suitable in each individual case. The process of adding software can be carried out sequentially, making a new partition image after installing each required set. The algorithm is as follows (see above for details):

  1. Loading the OS in audit mode
  2. Install/remove software, connect printers, create shortcuts, etc.
  3. We prepare the system for deployment using sysprep and turn off the computer
  4. Booting from live CD or Windows7 distribution, go to console
  5. Create a partition image using imagex by placing it on a flash drive or network resource
  6. We repeat the above until all the necessary sets have been created.

Creating your own Windows distribution

Having an image of the Windows partition (wim file), you can create your own distribution, that is, an installation DVD/Flash disk. To do this, it is enough to replace the \sources\install.wim file in the original distribution with your own image, renaming it accordingly to install.wim.

To automate the installation, you can prepare an autounattend.xml answer file by creating it using WIAK and placing it in the root of the distribution.

The development of technology, the emergence of new generations of components that work much faster and are more economical, allows us to extend the life of computers and delay the need to purchase a new, more productive model. One option for such an upgrade would be to replace a traditional hard drive with its solid-state counterpart.

Considering the excellent speed characteristics of such disks, using them as system disks is the best solution. We will tell you about possible problems that may arise when transferring a system partition from a classic hard drive to an SSD. We will talk about the Windows 8 system installed on a Lenovo laptop, and similar issues of modernization, repair, and computer setup Apple We'll leave it for another time.

Wim image binding

Windows 8 has a factory reset mode when problems occur that cannot be fixed by any other means. This will entail the loss of all installed programs, settings, personal data, etc., but all defects in operation will disappear, and the system will return to its original form.

When replacing a disk and after the accompanying procedure of transferring the system from an old disk to a new one, it happens that the binding to the Windows 8 system recovery environment of the OS wim image with factory settings is broken. It is contained in the hidden Recovery partition. The result of violating this binding is the impossibility of rolling back the system to factory settings.

Next, we will describe the process of how to restore the wim image binding. For example, we used a Lenovo laptop with a UEFI BIOS. The algorithm of action will be similar for devices from other manufacturers. The difference may lie in the names of menu items and some other little things.


If you don’t have confidence in your abilities, and what is described below looks too complicated, then it would be best to go to the launch.rf workshop computer repair in Otradnoye and find out when they can help you with this problem.

You need to go to the Disk Management utility. There we will see that all partitions, including the hidden Recovery, on the system disk are intact.


First of all, make sure that the recovery environment is enabled by entering “reagentc /info” in the command line.

In response, we will receive a message that the recovery environment is disabled. This happened after migrating the system from an old hard drive to an SSD. You need to turn it on. The command “reagentc /Enable” is intended for this.

The REAgentC program will report that the recovery environment (Winre.wim file) is enabled, and its standard location is in the hidden first partition of the disk - \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE. The problem is that the location of the recovery image is unknown. This means that if you use Push-Button Reset Overview, the Windows installation DVD will be used as the image.


Previously, we established that we have all the necessary partitions, including the hidden Recovery with the wim image, and the problem is the missing connection between this image and the system recovery environment. Let's start restoring the connection. You will need a command line where you need to enter several commands in sequence:

  1. "Diskpart".
  2. “lis vol” – a list of all disk partitions is displayed.
  3. “sel vol 4” – select the partition containing the desired recovery image.
  4. “assign letter M” – assign the letter “M” to section 4.
  5. “exit” – exits the Diskpart utility.


Now you should open “Explorer”, in which the “M” drive will appear. To control, you can check that the “install.wim” file containing the factory image of the system is located on this drive.


Let's return to the command line and continue working. “M:” – with this command we go to the “M” drive.

The next directive is “attrib /s /d”. With its help, the full paths of files located in the directory and subdirectories on a given disk and their attributes are displayed on the screen. We see that the “Factory” subdirectory we are interested in has attributes S “system”, H “hidden”, R “read only”, which we do not need and need to be cleared.


To do this, enter the commands:

  1. “cd OKRBackup\Factory” – change the current directory to L:\OKRBackup\Factory.
  2. “attrib -s -h -r /s” – remove the listed attributes from all files in this directory.
  3. “attrib /s /d” – control that attributes have been removed.


“C:” – goes to the system drive.

Now we bind the wim image with the command “reagentc /setosimage /path M:\OKRBackup\Factory /index 1”. If everything went well, then when you roll back to the original settings, information from the desired disk partition (from the wim image) will be used. To verify this, you can run the command "reagentc /INFO".


Push-Button Reset Overview (one-button system reset)

Just in case, we will briefly describe the procedure for returning to factory settings. You need to go to “Options”.



Click the “Start” button in the “Remove all data and reinstall Windows” item.


A warning window will appear telling you what action will be taken. You need to click the “Next” button.


The system rollback procedure to factory settings will begin.

If the OS does not start

You need to boot from the Windows 8 installation media, click “Next”.


Click "System Restore".


In the “Select action” window that opens, click “Diagnostics”.


Select the “Return the computer to its original state” mode.



Then select “Windows 8.1”.


The last window will open, in which you can click the “Return to original state” button.


The process of restoring the system to factory settings will begin.


Reading reviews from owners of a Dell 7720 laptop with pre-installed Windows 8 about the difficulties in deploying this same Windows 8 from the Recovery partition of the laptop hard drive onto SSD drives, or more precisely, the inability of the Dell Backup and Recovery utility to deploy the factory image on an SSD, I set out to do a recovery system to an SSD disk from an image file manually. It turns out to be an interesting situation - people, having bought a laptop, paid for pre-installed Windows 8, but they cannot transfer it to an SSD, they cannot update it from there to Windows 8.1 for free.

The recovery image file on the Recovery partition is divided into 4 parts: Install.swm, Install2.swm, Install3.swm, Install4.swm.

Let's roughly divide the whole process into stages:

  • Building a factory image file Install.wim of four parts into which it is divided: Install.swm, Install2.swm, Install3.swm, Install4.swm.
  • Preparing an SSD disk, creating partitions for system deployment.
  • Install.wim to the prepared section.
  • ESP(EFI System Partition) partition.

Building the factory image file Install.wim

To compile the file, it is perhaps most convenient to use the installed OS: this can be an additional system on a laptop or a system on a home desktop computer. I will not describe how to put the Install.swm, Install2.swm, Install3.swm, Install4.swm files there.

The most troublesome thing will be for Windows 7 owners, because... To merge the file, they will have to download and install a package on the system Windows AIK for Windows 7 weighing approximately 1.2 GB: download (the package is installed entirely and its main weight consists of wim images for building WinPE), or the package Windows ADK for Windows 8 weighing 2.5 GB: download. This is an on-line installer. Here is the complete set on the torrent tracker. It has a custom installation and you can install only 40 MB by checking only the second item from the top. I gave links to the download as an example, you can search for them on the Internet and download them yourself.

Place the files Install.swm, Install2.swm, Install3.swm, Install4.swm. to the root of drive C. Why exactly to the root of the disk? Yes, it’s just that the commands entered will be shorter, specifically to the root of the C drive, because some have only one C partition and others don’t.

Windows AIK for Windows 7, then run the deployment tools command line as administrator and use imagex collect the file by entering the command imagex /export c:install.swm 1 c:install.wim /ref c:install*.swm

As you can see from the screenshot, assembling the file took more than 2 minutes when the final file size was more than 13 GB (the image was assembled on another SSD).

If you have Windows 7 and have installed Windows ADK for Windows 8, then run the command line of the deployment and imaging tools environment as an administrator, and using DISM collect the file by entering the command


If you have Windows 8, then you are the luckiest: there DISM already built into the system, you don’t need to download anything additional, just run the command line as administrator and run the previous command to build the file dism /Export-Image /SourceImagefile:C:install.swm /SWMFile:C:Install*.swm /SourceIndex:1 /DestinationImageFile:C:Install.wim

That's it, the file is collected. This is Install.wim in the root of drive C. Which of the three proposed methods you will proceed with is up to you to decide. Surely there are other ways.

Preparing an SSD disk, creating partitions for system deployment

Preparing an SSD disk includes creating ESP(EFI System Partition) partition where the download files will be located and the creation of a partition for the future system. Because There is always not enough space on the SSD, so we will not make any recovery partitions, MSR We will also not create a (MicroSoft Reserved) section as it is unnecessary - we only need the system. By the way, the 128 MB MSR partition is present on the vast majority of GPT disks, and their owners do not even know that they have 1 more partition than they think: it is not visible in disk management, and, for example, Acronis Disk does not see it either Director.

Launch the command line. To do this, we boot from the WinPE4 disk. You can connect the SSD to a running Windows 8 system and call the command line from it.

I booted from a WinPE4 disk, i.e. based on Windows 8.

Next I will write the commands, briefly explaining each one. Commands can be written in capital letters, and not like mine. I will also write commands without abbreviating words (sel, lis, dis, part, vol), i.e. completely, to make it more meaningful (select, list, disk, partition, volume).

diskpart(called the partition manager)
list disk(a list of disks will be shown, you need to remember the number of the SSD disk: 0, 1, etc. Let our SSD be disk 0)
select disk 0(select SSD disk)
clean(clear it completely)
convert GPT(convert it to GPT)
create partition EFI size=100 offset=1024(creating a 100 MB ESP partition with 1 MB offset)
format quick fs=FAT32(quick format it to FAT32)
assign letter=R(we temporarily assign any letter to the ESP section, for example, R)
create partition primary(creating a partition for all remaining space)
format quick fs=NTFS(quickly format it to NTFS)
assign letter=S(we assign any letter to the created NTFS partition, for example, S. I don’t know, maybe the letters C, D, E, etc. are already taken by you, so I took a letter from the middle of the alphabet. Don’t worry, the deployed system will be on drive C , as intended by the manufacturer, and these letters: R and S are given to partitions temporarily to copy download files (in this case from S to R).
exit(left diskpart)

Deploying a system from a factory image Install.wim to the prepared section.

  • Select tab Application(Apply).
  • As Source(Source) select the merged file Install.wim.
  • As Recipient(Destination) indicate the section we created with the letter S.
  • Press the button Apply(Apply).


Copying system boot files to ESP(EFI System Partition) partition

The command written below is executed on the command line: either a WinPE boot disk based on Windows 8, or on a Windows 8 system (this is if you have attached an SSD to it). Do not try to run this command from the Windows 7 installation disk and bootable WinPE made on its basis! Launch the WinPE4 disk command line and enter the command bcdboot S:Windows /l ru-Ru /s R: /f UEFI(let me remind you that the letters S and R were assigned by us earlier)
exit (exit command line)

The whole process, all 4 stages, took about 15 minutes. That's all, you can boot from the SSD disk, accept the license agreement, choose names for yourself and your computer, and now we are greeted with pre-installed Windows 8.

I'll add an important note

If at step 2 you chose to boot from a WinPE4 disk, then perform all the remaining steps from it without rebooting. Otherwise, all assigned letters will be lost. If you connected an SSD drive to a computer with Windows 8 installed, then also perform steps from two to four without rebooting.

Added a video to this article.

I hope it will be clearer this way. The video shows all stages except the first (gluing the system image file).

Note: You can buy an inexpensive branded ahd DVR at any time convenient for you by simply visiting the online store https://www.arax-cctv.ru/vregistrators/videoregistratory-ahd/". We recommend this company for cooperation!

That's all! Thank you for your attention and see you again on the pages of the site site

In the main WinSetupFromUSB window, select the name of our flash drive.

Put a tick on the item Auto format it with FBinst and check the FAT32 box,

Check the box Vista/7/8/Server 2008/2012 based ISO and click on the button that opens the Explorer window.

Explorer opens, find the ISO image of the Live CD AOMEI PE Builder on the computer and select it with the left mouse, click “Open”.

Click “GO”.

"Yes"

The creation of a bootable Live CD AOMEI PE Builder flash drive begins.

The bootable USB flash drive is ready.

"OK"

We boot the laptop from the bootable USB flash drive Live CD AOMEI PE Builder. Our flash drive is universal; from it you can boot a laptop with a UEFI interface, as well as a regular BIOS.

Press “Enter” on the keyboard.

The Live CD AOMEI PE Builder desktop loads, which is a regular Live CD based on Windows 8.1.

We connect a portable USB hard drive or a regular flash drive with a capacity of 16-32 GB to the laptop.

Click on the Windows Disk Management button.

In disk management, three drives connected to the laptop are visible.

Disk 0. Laptop hard drive with all partitions:

The first hidden partition without a letter, volume 450 MB, contains the Windows 8.1 recovery environment.

The second hidden partition without a letter, volume 100 MB, with EFI system partition (contains the boot configuration store (BCD) and operating system boot files).

Partition (C:) with Windows 8.1 installed, which does not boot.

Section (D:) with user data files.

The last hidden partition without a letter, volume 20.37 GB, is where the factory image of Windows 8.1 is located. We need to enter this partition and copy the factory WIM image to a portable USB hard drive (I’ll explain why later).

Disc 1. Bootable USB flash drive Live CD AOMEI PE Builder.

Disc 2. Portable USB hard drive, capacity 1 TB.

Before work, the drive (C:) needs to be formatted. Right-click on it and select “Format”

"OK"

The drive (C:) is formatted.

Launch the command line

and assign a letterhidden partition, volume 20.37 GB.

Enter the commands:

diskpart

lis vol (list all hard drive partitions)

sel vol 5 (using this command we select hidden RECOVERY partition without a letter, volume 20.37 GB, with a factory image of Windows 8.1)

assign (the command assigns a letter to the hidden partition).

Open the My Computer window and see that the hidden partition is assigned a letter (E:), go to this partition.

First of all, we enable the display of hidden files and folders, otherwise we will not see the factory WIM image with Windows 8.1, since it has the “Hidden” attribute. Left-click on View and check the “Hidden” items box.

Next we look in the folders factory WIM image. On my laptop it is in the folder"Factory" is called install.wim. Regardless of the laptop manufacturer, the file containing the factory image of Windows called install.wim.

Sometimes this file is divided into several files with the extension .swm I will also explain to you what to do with these files later in the article.

So, let's copy our file install.wim to a portable USB hard drive. Right-click on the file and select"Copy"

Go to the partition (H:) of the portable USB hard drive.

Right-click on an empty space and select Paste.

File install.wim is copied to the partition (H:).

File install.wim is copied to the partition (H:).

Friends, now all we have to do is expand the contents of the file using the command line install.wim(factory image of Windows 8.1) to disk (C:), for this you need to enter only one command, but you need to enter it correctly, the file index must be indicated in the commandinstall.wim and it's easy to define.

Any install.wim file must have a so-called image index and in the next command we must specify it. To determine the image index of the install.wim file, open the command line and enter the command:

DISM /Get-WimInfo /WimFile:H:\install.wim

Where H:, the drive letter where the file is located install.wim.

As you can see, the image index 1 .

Accordingly, enter the following command:

imagex /apply /check H:\install.wim 1 C:\

where image /apply /check H:\install.wim 1 C:\, means unpack the file install.wim from disk (H:) with checking the image for errors, on disk (C:), and 1 is the image index.

The Windows 8.1 image from the file begins to unpack install.wim to drive (C:). In other words, we did it using the command line and the utility ImageX is what the factory reset program was supposed to do - deploy the factory image from the hidden partition to the (C:) drive.

Progress 100%. Unpacking completed successfully. Factory Windows 8.1 deployed to disk (C:)!

We reboot the laptop and enter the final phase of installing Windows 8.1.

We do not change the language and regional settings.

We accept the terms of the license agreement.

The laptop manufacturer may ask you to create your ID and register the system. You can refuse by unchecking the appropriate boxes.

Enter the computer name.

You can immediately set up an Internet connection via WI-FI or refuse.

"Skip this step".

You can manually configure the settings, as I told you how to do this.

Or you can “Use standard settings”

Enter your username and click “Finish”

Windows 8.1 is loading.

When you connect to the Internet, the operating system is automatically activated.

I foresee your questions:

1. Hello admin! You found out the image index install.wim using the utilityDISM, why didn’t you further deploy the image using it?

Yes, you are right, you can use the DISM utility, the command will look like this:

Dism /apply-image /imagefile:H:\install.wim /index:1 /ApplyDir:C:\

but since Windows 7 I’ve gotten used to the ImageX utility, DISM does the same thing, but the commands are 2 times longer, which means the likelihood of errors (especially for an inexperienced user) increases.

2. Why transfer the install.wim file from a hidden partition of the laptop hard drive to a portable USB hard drive?

Basically, it doesn't matter where the file is located install.wim, and on the command line you can specify the full path to the file, for example, in my case, the command would look like this:

imagex /apply /check E:\OKRBackup\Factory\install.wim 1 C:\

3. What should I do if there is no file on my laptop in the hidden section? install.wim, and there is a group of files:

install4.swm...?

In this case, you need to add a key ref and the command will look like this:

imagex /apply /check /ref H:\install*.swm H:\install.swm 1 C:\

If you use DISM, the command will look like this:

Dism /apply-image /imagefile:H:\Install.Swm /SWMFile:H:\install*.swm /index:1 /ApplyDir:C:\

4. After expanding the file install.wim, the Windows 8.1 bootloader gave an error. What to do?

It is better to restore the bootloader in a recovery environment. There is a shortcut on the Live CD AOMEI PE Builder desktop to go to the WIN 8.1 recovery environment - Windows Recovery Environment.

5. I have a 32-bit operating system and your image Live CD AOMEI PE Builder 64 bit, not suitable for me.


Sometimes Winre.wim and other WIM system errors can be related to problems in the Windows registry. Several programs can use the Winre.wim file, but when those programs are uninstalled or modified, sometimes "orphaned" (incorrect) WIM registry entries are left behind.

Basically, this means that while the actual path of the file may have changed, its incorrect former location is still recorded in the Windows registry. When Windows tries to look up these incorrect file references (file locations on your PC), Winre.wim errors can occur. Additionally, a malware infection may have corrupted registry entries associated with Microsoft Windows. So, these corrupted WIM registry entries need to be fixed to fix the problem at the root.

Manually editing the Windows registry to remove invalid Winre.wim keys is not recommended unless you are PC service professional. Mistakes made when editing the registry can render your PC inoperable and cause irreparable damage to your operating system. In fact, even one comma placed in the wrong place can prevent your computer from booting!

Because of this risk, we highly recommend using a trusted registry cleaner such as WinThruster (Developed by Microsoft Gold Certified Partner) to scan and repair any Winre.wim-related registry problems. Using a registry cleaner, you can automate the process of finding corrupted registry entries, missing file references (like the one causing the Winre.wim error), and broken links within the registry. Before each scan, a backup copy is automatically created, allowing you to undo any changes with one click and protecting you from possible damage to your computer. The best part is that eliminating registry errors can dramatically improve system speed and performance.


Warning: Unless you are an experienced PC user, we DO NOT recommend manually editing the Windows Registry. Using Registry Editor incorrectly may cause serious problems that may require you to reinstall Windows. We do not guarantee that problems resulting from incorrect use of Registry Editor can be corrected. You use Registry Editor at your own risk.

Before you manually repair your Windows registry, you need to create a backup by exporting a portion of the registry associated with Winre.wim (eg. Microsoft Windows):

  1. Click on the button Begin.
  2. Enter " command" V search bar... DON'T CLICK YET ENTER!
  3. While holding down the keys CTRL-Shift on your keyboard, press ENTER.
  4. A dialog box for access will be displayed.
  5. Click Yes.
  6. The black box opens with a blinking cursor.
  7. Enter " regedit" and press ENTER.
  8. In the Registry Editor, select the Winre.wim-related key (eg. Microsoft Windows) you want to back up.
  9. On the menu File select Export.
  10. On the list Save to select the folder where you want to save the Microsoft Windows key backup.
  11. In the field File name Enter a name for the backup file, such as "Microsoft Windows Backup".
  12. Make sure the field Export range value selected Selected branch.
  13. Click Save.
  14. The file will be saved with extension .reg.
  15. You now have a backup of your Winre.wim-related registry entry.

The following steps for manually editing the registry will not be described in this article, as they are likely to damage your system. If you would like more information about editing the registry manually, please check out the links below.