Computers Windows Internet

Dism removal. DISM console utility. How to use it to restore damaged components. Using the ScanHealth option in Dism

The DISM command is used to view, install, uninstall, and configure components in Windows WIM images ( W indows IM aging Format). Since Windows 7, the utility dism.exe (D eployment I mage S ervicing and M anagement) included as standard software installed Windows OS. Represents a remedy command line which can be used to serve Windows images and replaces the Package Manager (Pkgmgr.exe), PEimg, and Intlcfg that were included in Windows Vista. Functionality of these funds are now collected in one tool dism.exe... In addition, new features have been added to improve the offline image servicing capabilities.

Unlike sector-oriented formats (such as .iso, .tib, .bin), a WIM image is a file-oriented format, that is, its smallest logical element is file... This format was developed by Microsoft as the primary deployment tool for Windows Vista and later operating systems. Its advantages are hardware independence and the ability to store only one copy of a file that has many links in the tree file system(single instance storage), which ensures compactness of images and high speed of their deployment.

A WIM file can include multiple images, which are identified by a numeric index or unique name. Single copy set technology identical files single instance storage when adding a new image to existing ones, it allows you to reduce the size of the WIM database if there are matching elements. WIM image can also be split into several files, which are assigned the extension .swm

WIM image can be mounted as logical drive in the Windows environment with the assignment of a drive letter to it to facilitate editing of its contents (thanks to this, the WIM image can be easily converted to an ISO image). In addition to standard utilities from Microsoft, you can also extract files from a WIM image using the 7-Zip archiver.

WIM images can be bootable. In particular, the installation of all modern operating systems of the Windows family is performed using an image file named BOOT.WIM containing boot version Wednesday before Windows installations PE (Windows P reinstall E nvironment) from which the installation process of the system itself is performed using the contents of an image file named INSTALL.WIM. After a standard Windows installation, a Windows RE recovery environment is created ( R ecovery E nvironment), which is loaded from the image WinRE.WIM to restore performance in case of problems with loading the main system. Typically, the winre.wim image is located in a hidden partition that is not assigned a drive letter.

The structure of a WIM file containing 2 images:

As you can see, the wim file contains 6 types of content:

WIM Header- wim file header describing content, attributes, version, size, compression type, etc.

File Resources- a sequence of packages containing packed file data as part of an image.

Metadata Resource- contains information about the files in the image, including the folder structure and attributes.

Lookup Table- table of locations and sizes of resource files in the .wim file

XML Data- data in XML format with additional information about the image. They are uncompressed Unicode text.

Integrity Table- integrity table used for control working condition image

The process of creating a WIM image can be summarized as follows:

1. The title is created WIM Header image file, for example C: \ data.wim
2. In memory, metadata is created when scanning and indexing the source data directory that is collapsed into an image, for example - C: \ Sources \
3. Based on the metadata, the contents of the files from the source data directory are written with compression to the image file in the form of batch portions File Resources, and at the same time, a table of allocation of portions in the image is built in memory Lookup Table
4. Upon completion of image creation, the table Lookup Table is written from memory to the .wim file, then the XML and integrity data are appended.
5. The initial header of the WIM file is updated.

The process of extracting files from the image is performed according to the following algorithm:

1. The header is read WIM Header and the location of the metadata in the WIM is determined.
2. Metadata is rewritten into computer memory and a table of file locations inside the image is built.
3. A directory structure is created based on the contents of the image.
4. Files from the image are processed using the constructed tables and copied to the created directory structure.

For more information on the structure of WIM files, see the Software Developers Document (in PDF format in English).

Performance DISM.EXE without parameters, displays a brief help on how to use it. The utility log is saved to a file C: \ Windows \ Logs \ DISM \ dism.log

Command line format:

DISM.exe (/ Image: offline_image_path | / Online) [dism_options] (service_command) [service_command_args]

The format of the DISM command differs depending on whether the utility is running offline or with Windows data (mode / Online) where DISM.EXE is running. The utility requires running the command line as administrator.

Utility commands for working with disk images:

/ Split-Image- Divides an existing .wim or .ffu file into multiple read-only WIM / FFU files.

/ Apply-Image- Applying new image parameters.

/ Get-MountedImageInfo- Displays information about mounted WIM and VHD images.

/ Get-ImageInfo- Displays information about images in a WIM or VHD file.

/ Commit-Image- Saves changes to a mounted WIM or VHD image.

/ Unmount-Image- Disconnects a mounted WIM or VHD image.

/ Mount-Image- Mounts an image from a WIM or VHD file.

/ Remount-Image- Restores the mount directory of the image.

/ Cleanup-Mountpoints- Removes resources associated with corrupted mounted images.

Service commands:

/ Apply-CustomDataImage- Preserves the files contained in the custom data image.

/ Capture-CustomImage- Writes settings to a delta WIM file on the WIMBoot system. Recorded directories include all subfolders and data.

/ Get-WIMBootEntry- Lists the WIMBoot configuration entries for the specified disk volume.

/ Update-WIMBootEntry- Updates the WIMBoot configuration entry for the specified disk volume.

/ List-Image- Displays a list of files and folders in the specified image.

/ Delete-Image- Removes the specified volume image from a .wim file containing multiple volume images.

/ Export-Image- Exports a copy of the specified image to another wim file.

/ Append-Image- Adding another image to the .wim file.

/ Capture-Image- Writes a disk image to a new .wim file. Recorded directories include all subdirectories and data.

/ Get-MountedWimInfo- Displays information about images mounted from WIM.

/ Get-WimInfo- Displays information about images in a .wim file.

/ Commit-Wim- Saves changes from a WIM mounted image.

/ Unmount-Wim- Disconnects a WIM-mounted image.

/ Mount-Wim- Mounts an image from a WIM file.

/ Remount-Wim- Recovers lost WIM mount directory.

/ Cleanup-Wim- Removes resources associated with corrupted mounted WIM images.

Image specifications:

/ Online- Sets a running operating system as the destination.

/ Image- Specifies the path to the root directory of the offline Windows image.

DISM options:

/ English- Displays command line output in English.

/ Format- Sets the format of the report. Valid values ​​are / Format: Table or / Format: List, specifying the format as a table or list. The default is a list.

/ WinDir- Specifies the path to the Windows directory.

/ SysDriveDir- Specifies the path to the boot loader file named BootMgr.

/ LogPath- Specifies the path to the log file.

/ LogLevel- Sets the level of event logging (1-4).

/ NoRestart- Prevents automatic reboot and displaying prompts to the user to reboot.

/ Quiet- Hides all messages except error messages.

/ ScratchDir- Specifies the path to the directory of temporary files.

For information about these DISM options and their arguments, specify the required option before "/?".

Examples:

DISM.exe / Mount-Wim /?- command prompt / Mount-Wim
dism.exe / Format /?- display help on DISM output formats.

dism.exe / Online / Get-Drivers /?- hint for the mode of displaying information about drivers in the image or running Windows (/ Online). By default, a list of third-party drivers is retrieved. To display the entire list of drivers, use the parameter / all.

dism.exe / Online / Get-Drivers / format = table- display a list of third-party drivers of the current Windows in the form of a table:

DISM.exe / List-Image /Imagefile:C:\test\images\myimage.wim / index: 1- display the full contents of the first image from the file specified by the parameter / Imagefile:

Working with offline images.

dism / mount-wim /?- display a hint on the mode of connecting images.

DISM system
Version: 10.0.10586.0
/ Mount-Wim / WimFile: path_to_wim-file (/ Index: image_index | / Name :) / MountDir: destination_mount_directory- Mounts a .wim file to the specified directory so that it is available for servicing.
Use the / ReadOnly parameter to make the attached image read-only.
Examples: DISM.exe / Mount-Wim /WimFile:C:\test\images\myimage.wim / index: 1 / MountDir: C: \ test \ offline
DISM.exe / Mount-Wim /WimFile:C:\test\images\myimage.wim / index: 1 / MountDir: C: \ test \ offline / ReadOnly

DISM.exe / Mount-Wim /WimFile:D:\sources\boot.wim / MountDir: C: \ test \ offline- connect to the directory C: \ test \ offline image content D: \ sources \ boot.wim... After successful execution of this command in the directory specified by the parameter / MountDir the contents of the image from the WIM file specified by the parameter will be available. / WimFile and commands for serving images will be available.

DISM.exe / Image: C: \ test \ offline /?- display a quick reference for the commands and options for serving offline images.

DISM.exe / Image: C: \ test \ offline / Add-driver /?- display a hint on the procedure for adding a driver to an offline image.

DISM.exe / Image: C: \ test \ offline / Get-Features- display information about all components included in this image. To display information about an individual package, use the parameter / PackagePath pointing to a cab file or folder.

dism / Get-MountedImageInfo- display information about mounted offline images. Example of displayed information:

Connected images:

Connection directory: C: \ test \ offline
Image file: C: \ test \ images \ myimage.wim
Image Index: 1
Connected for reading or writing: Yes
Condition: OK
. . .

dism / unmount-wim / MountDir: C: \ test \ offline / commit- disable offline image mounted to directory C: \ test \ offline with saving the changes made (saving with committing, set by the parameter / commit).

dism / unmount-wim / MountDir: C: \ test \ offline / Discard- the same as in the previous example, but without saving changes to the contents of the image (saving without committing).

Adding Drivers to a WIM Image

The need to add a driver arises in cases where the installation of the system or Windows boot PE requires non-standard drivers such as SCSI and RAID disk controllers or unsupported peripherals. The DISM utility makes it easy to add the required driver to an existing image based on information from .inf files.

Command format:

DISM / Image: image / Add-Driver (/ Driver: folder_inf_containing | /Driver: path_to_driver.inf) / ForceUnsigned]

A new driver is being added to the offline image specified by the parameter / Image:... To search for drivers in all subfolders, use the option / recurse... To add all unsigned drivers to X64 images, use the parameter / ForceUnsigned.

DISM.exe / Image: C: \ test \ offline / Add-Driver / Driver: D: \ Drivers / recurse- add all drivers from the catalog to the image D: \ Drivers and its subdirectories.

DISM.exe / Image: C: \ test \ offline / Add-Driver /Driver:D:\Drivers\Usb\Usb3.inf- add a driver to the offline image based on information from the file D: \ Drivers \ Usb \ Usb3.inf

DISM.exe / Image: C: \ test \ offline / Add-Driver /DriverName:"C:\Drivers\1.inf "/DriverName:"C:\Drivers\2.inf" / DriverName: "C: \ Drivers \ 3.inf "- adding several drivers in one command. When adding multiple drivers, they are installed in the same order as they are listed on the DISM command line

Successful execution of DISM in mode / Add-Driver does not mean a change in the contents of the image, since to apply the changes, you must either disable the image with the parameter / commit, or apply the changes using the parameter / Commit-Image

DISM.exe / Commit-Image / MountDir: C: \ test \ offline- save changes in the image mounted to the directory specified by the parameter / MountDir

Using DISM to manage components of the current Windows operating system.

Command DISM with parameter / Online is performed in relation to the current operating system, and not to its image, which allows you to perform system maintenance by removing, adding or changing its components. Windows servicing refers to monitoring and fixing the health of components and software packages, including all system files and the registry. Component based service system or CBS ( C omponent B ased S ervicing) is a set of service software tools and specialized data, of which the utility is a part DISM.EXE

The initial elements of the component servicing system were implemented in Windows Vista. In each subsequent release of the OS, their capabilities expanded, which led to some serious differences both in CBS itself and in the use of the DISM.EXE utility in different versions Windows OS. Some of the settings available in Windows 10 are not applicable in Windows 7, although Microsoft has retroactively released updates that partially implement the new servicing concepts that appeared in Windows 8, 8.1, 10. Some of the servicing capabilities that were present in Windows 8 are missing, or have undergone significant changes in Windows 10. I will add that Windows servicing is a complex, not yet fully formed system, many features of which are not documented and many concepts of which may seriously change in the future.

Brief hint on using the mode / Online for a specific Windows versions can be obtained by command:

DISM / Online /?

Examples of using DISM / Online for typical Windows servicing operations.

As a storage for system components, a WIM image, data obtained remotely through Windows Update, or the local storage of current Windows, which is the contents of the folder % windir% \ WinSxS(Standard - C: \ Windows \ WinSxS). Using the parameter / Source you can specify the location of file versions that can be used for recovery. Parameter / LimitAccess can be used to prevent updates from Windows Update.

DISM.exe / Online / Cleanup-Image / CheckHealth- check for a sign of damage to the image or component storage. Not applicable on Windows 7.

Scanning the system component store. In Windows 7, in addition to scanning, integrity recovery is also performed. This version of the command is not executed and is accompanied by the message Error 87. ScanHealth parameter not recognized in this context if the update is not installed on Windows 7 KB2966583.

DISM.exe / Online / Cleanup-Image / RestoreHealth- check of the repository of components and automatic recovery. In Windows 7, these functions are performed by the command
DISM.exe / Online / Cleanup-Image / ScanHealth

dism.exe / Online / Cleanup-Image / StartComponentCleanup- clean up replaced components and reduce the storage size (\ Windows \ WinSxS folders). Not applicable in Windows 7 environment.

dism.exe / Online / Cleanup-Image / StartComponentCleanup / ResetBase- the same as in the previous example, plus resetting the base of replaced components. After resetting the bases installed Windows updates it is impossible to delete.

DISM.exe / Online / Cleanup-Image / AnalyzeComponentStore- creating a status report local storage WinSxS components. Possible only for Windows 8.1 - 10. Example of displayed information:

Component Store Information (WinSxS):
File Explorer Component Store Size: 5.43 GB
is the size of the WinSxS folder as calculated by the explorer. It does not take into account the use of hard links in the WinSxS folder
Actual size of component store: 5.10 GB - takes into account hard links in the WinSxS folder.
Shared with Windows: 3.18 GB - the size of files that are rigidly linked in such a way that they appear both in the component store and in other locations (for normal Windows work). It is included in the actual size, but should not be considered part of the component store overhead.
Backups and disabled features: 1.62 GB - the size of the components, which are stored to be used in case of failures in newer components or to provide an option to include additional functionality. The value also contains the size of the components used in parallel and the component store metadata.
Cache / Temporary Data: 304.02 MB - the size of files that are used internally by the component store to speed up component maintenance operations. It is included in the actual size and is part of the component store overhead.
Last cleanup date: 2016-10-04 09:45:15
Packets to be released: 3
Cleanup of the component store is recommended: Yes
The operation completed successfully.

The use of analysis allows you to assess the need to clean up the WinSxS storage and determine the maximum reduction in its size, which cannot be more than what is used for Backups and disabled components.

dism / Online / Get-Features- display a list of components of the current system.
Example of displayed information:

Function name: SNMP
Status: Disabled
Function name: TelnetClient
Condition: Included

V this example, SNMP support is disabled, and Telnet Server Client is enabled.

DISM.exe / Online / Enable-Feature: SNMP- enable the "SNMP-protocol" component

It is possible to restore and include components that were previously removed from the image. Use an argument / Source to ask file location required to restore a previously deleted component. Multiple arguments can be specified / Source... If the component is found in the first source, then the remaining sources are ignored.
The / LimitAccess parameter prevents DISM from accessing WU / WSUS.
The / All switch includes all the parent components of the specified component.

DISM.exe / Online / Get-Featureinfo: TelnetClient- display information about the component "Telnet Client"

DISM.exe / Online / Disable-Feature: SNMP- disable the "SNMP-protocol" component.

Dism ++ is free program, which allows you to automate useful functions of the same name Windows utilities... With its help, you can clear cache and other garbage, manage applications, passwords, create copies of system files, restore the OS - and all this without much manipulation of manual settings.

How to work with the Dism ++ program.

When problems arise in the operation of the OS, you can eliminate them using the Dism options - then you will understand how to use them without and with the application. There are three main commands we need:

  • CheckHealth - OS diagnostics;
  • ScanHealth - control diagnostics;
  • RestoreHealh - fixing detected problems.

Before using such options manually (via the Command Line), you should make a copy of the OS or get a bootable disk just in case. If you have Dism ++ installed, it is safer, because the application itself performs the necessary actions at your command. The above options in this case are collected in sections depending on the needs of the user, and their action is described in Russian.

Using CheckHealth Option in Dism

As already mentioned, the CheckHealth team at Dism is responsible for the initial diagnostics of the OS and finding problems, but that's all. She is unable to fix the problem. In order to activate the option manually, you need the following:

  1. Open Windows Search and write Command Prompt.
  2. Wait for the application to appear in the list and click on it right click mice.
  3. You need to select "Run As Administrator" so that the system does not block the request in the future.
  4. In the black field, write: "DISM / Online / Cleanup-Image / CheckHealth" without quotes and click "Enter".

Now wait while the program checks everything and delivers a verdict. Even if you see a message stating that no damage was found, do not stop and move on to the next command. The Dism ++ utility for Windows works differently: click the "Advanced" - "Recovery" tab and follow the instructions.

Using the ScanHealth option in Dism

This option re-checks the system for errors, and more slowly and thoroughly than the previous one.

  1. Open the "Command Prompt" again (do not forget, we need to specify: "Run As Administrator") and run the Dism command: DISM / Online / Cleanup-Image / ScanHealth.
  2. We are waiting for the completion of the operation. If damage is found in the process, proceed to regeneration.

Using the RestoreHealth option in Dism

RestoreHealh exists to restore system files. It is also launched through the Command Line.

  1. Run the command: DISM / Online / Cleanup-Image / RestoreHealth.
  2. We click "Inter".
  3. We are waiting for the results of the regeneration.

Perhaps, when the check is completed by a quarter, the percentage counter will freeze for a while - do not be alarmed, it should be so.

Using the RestoreHealth and Source options in Dism

If your system is severely damaged, you will need OS image files written to removable media to recover it. The Dism RestoreHealh team will contact them and troubleshoot. For this to happen, you need to tell her the location of the necessary components through the Sourse option.

  1. Run the Command Line (remember "Run As Administrator").
  2. Enter the command: DISM / Online / Cleanup-Image / RestoreHealth /Source:boot_disk_name\install.wim and click "Inter"

If The Update Center persistently offers itself as a source of components, you can control its activity by installing: DISM / Online / Cleanup-Image / RestoreHealth /Source:bootdisk_name \ install.wim / LimitAccess. Note that the OS on the disk (flash drive) must match the current one in all characteristics in order to avoid problems.

Using Dism with Install Esd File

If you upgraded Windows to a higher version, then useful components for system regeneration may remain on the system disk, you can specify the path to them. The service is started as follows:

  1. Open the Command Line (and again through Run As Administrator).
  2. Enter: DISM / Online / Cleanup-Image / RestoreHealth /Source:C:$Windows.~BT\Sources\Install.esd and click Inter.

Again, with the persistent recommendations of the Update Center, you can enter the command: DISM / Online / Cleanup-Image / RestoreHealth /Source:C:$Windows.~BT\Sources\Install.esd / LimitAccess. Thus, it will not bother you and distract the attention of the RestoreHealth option.

How to fix problems with Windows 10

Dism has in its arsenal another useful function designed to detect errors and restore normal Windows operation - SFC.

  1. Run Command Line again as administrator.
  2. Enter in the window: sfc / scannow and click "Enter".

In order for the operation to be successful, the service may need to be started three times: after completion, restart the computer and check if the errors have disappeared.

Dism ++ has the same set of recovery tools Windows systems 7, 8, 10, only all functions are automated. Daily tasks such as:

  • cleaning - deleting cache, garbage, temporary files, etc .;
  • autoload - control over programs that start together with the OS;
  • application management - remove any applications, including those that come with the OS;
  • OS optimization - speed up work, make safe changes to registry entries, remove useless widgets, prohibit auto-updates, firewall control;
  • driver management - deleting, getting information about them;
  • update management - a list of current updates, displaying applications that require them, the ability to remove freshly installed versions;

located in the left column of the menu. Features that are less commonly used are grouped under the heading "Advanced". This section contains:

  • account management - recovering and changing passwords, adding and removing users;
  • diagnostics and OS recovery (here everything that we described above is performed automatically in order);
  • restore downloads;
  • return to previous version OS.

Dism ++ also has an interesting function for corporate PCs (for example, for computer classes, offices, etc.) - recording a customized OS image. This means that the system that will be installed on the PC already contains all the programs necessary for the operation, and they do not have to be installed on each computer separately. You can find this option in the "Deployment" tab. However, to use it, you need to have some knowledge of operating systems. In the same way, you can immediately personalize your PC by introducing your account and bypassing the re-registration procedure in Windows. To do this, there is a tab "Answer file". The content of the file is written to boot disk, and then, during the installation process, instead of the username and password, they press the key combination: CTRL + SHIFT + F3.

It can be used to unpack (mount) an image file, add additional packages to the image file, integrate drivers, customize the image, and then re-package the modified image into a .wim file (unmount). In order not to specify the full path to the program file every time, you need to work with it from Deployment tools command line launched strictly with administrator access rights.

Let's consider the main command line parameters of the tool DISM.

As mentioned earlier, before making changes to the image, you need to mount it, this is done with the following command:

Code:

Dism / Mount-Wim / WimFile:<Путь к.wim-файлу>/ index: 1 / MountDir:<Путь к директории, куда будет смонтирован наш образ>

for example:

Code:

Dism / Mount-Wim /WimFile:C:\winpe\winpe.wim / index: 1 / MountDir: C: \ winpe \ mount

That is, the file C: \ winpe \ winpe.wim will be unpacked (mounted) into a directory C: \ winpe \ mount

After mounting, you can copy it to the directory with the unpacked image.

It seemed that this could be the end of the operation, pack our image back and burn it to a CD for further use. But the DISM program provides a few more features that it would be a sin not to take advantage of.

Device driver integration... This procedure is necessary in cases when you own a computer with non-standard devices (for example, RAID). The DISM subsystem allows you to integrate drivers from .inf files into an image. For this, the following parameters are used:

Code:

Dism / image:<Путь к директории со смонтированным образом>/ Add-Driver / Driver:<Путь к.inf-файлу>

for example:

Code:

Dism / image: C: \ winpe \ mount / Add-Driver /Driver:C:\Drivers\SCSIRAID\ATI\AMDHDC\amdhdc.inf

C: \ winpe \ mount , we have added the ATI RAID controller driver C: \ Drivers \ SCSIRAID \ ATI \ AMDHDC \ amdhdc.inf

Integration of additional packages... You can add the following packages to a mounted image:

Spoiler: Package List

  • WinPE-FONTSupport-<регион>
    Additional font support for the following languages: ja-JP, ko-KR, zh-CN, zh-HK, and zh-TW.
  • WinPE-HTA
    Support for HTML applications. Allows you to create GUI applications using a scripting engine Internet Explorer and HTML services.
  • Winpe-LegacySetup
    Installer component package Media. All setup files from the \ Sources folder on the Windows drive. Add this package when servicing the installation or the \ Sources folder on the Windows drive. The installer must be added with the component package. To add new file Boot.wim to disk, in addition to the installation and Media packages, add any child package. It is required to support the installation of Windows Server® 2008 R2.
  • WinPE-MDAC
    Support for Access Components Microsoft data®. Allows you to send requests to SQL servers with Active Directory Objects (ADO). Example use case: creating a dynamic file automatic start based on unique system information.
  • WinPE-PPPoE
    Includes PPPoE protocol support. Allows you to create, connect, disconnect and delete connections by PPPoE protocol from Windows PE.
  • WinPE-Scripting
    Server support Windows scripts(WSH). Allows to produce batch processing files using WSH script objects.
  • WinPE-Setup
    Installer component package (parent). All installer files from the \ Sources folder shared by the client and server.
  • WinPE-Setup-Client
    Client Installer component package (child). Client branding files for the installer. You must add the installer after the component package.
  • WinPE-Setup-Server
    Server Installer component package (child). Server branding files for the installer. You must add the installer after the component package.
  • WinPE-SRT
    Windows Recovery Environment component package. Provides a recovery platform for automated diagnostics and system recovery, and the creation of customized recovery solutions.
  • WinPE-WMI
    Toolkit support Windows management(WMI). A subset of WMI providers that provide minimal system diagnostics.
  • WinPE-WDS-Tools
    Windows Deployment Services Toolkit. Contains APIs that provide multicast scripting using a custom Windows Deployment Services client and an imaging utility.

This is done with the command:

Code:

Dism / image:<Путь к директории со смонтированным образом>/ Add-Package / PackagePath:<Путь к.cab-файлу>

for example:

Code:

Dism / image: C: \ winpe \ mount / Add-Package / PackagePath: "C: \ Program Files \ Windows AIK \ Tools \ PETools \ x86 \ WinPE_FPs \ winpe-hta.cab"

Here to the image mounted in the directory C: \ winpe \ mount , we have added the HTML Application Support Package.

Detailed information about packages can be found on this page.

Configuring Available Memory in Windows PE... While loading the preinstallation environment into random access memory A RAM disk is created on the computer and all the contents of the .wim image are extracted to. The amount of RAM available to the system and applications is fixed and is by default: 32 MB... If some applications do not have enough of this available memory, then they will not work. The size of the available RAM in the ready-made image cannot be changed, however, during the preparation of the image, it is quite possible to do this, for this we run DISM with such papameters:

Code:

Dism / image:<Путь к директории со смонтированным образом>/ Set-ScratchSpace:<Объем доступной RAM в MB>

for example:

Code:

Dism / image: C: \ winpe \ mount / Set-ScratchSpace: 128

Here we have set the size of the available RAM - 128 MB ... Don't get carried away - this value is more than enough for most applications.

And now, finally, we have configured our mounted image, now is the time to save all changes, unmount (unmount) it and pack it back into .wim file, this is done with the command:

Code:

Dism / Unmount-Wim / MountDir:<Путь к директории со смонтированным образом>/ Commit

Hello! I read your article yesterday: tell me, how to do the same with a more modern utility - Dism and using the usual installation Windows flash drives 10?

Hello friends! If you are a fan of the command line, then to create a backup image of Windows 10, you can use the system for servicing and deploying images of operating systems - Dism. The Dism utility came to replace three tools at once: Pkgmgr.exe, PEimg, Intlcfg, which were included in Windows Vista and can do everything they could and much more, for example: add and remove drivers and language packs from a Windows image, enable and disable various Windows components, and more. With Dism, you can even include and exclude other operating system images from a WIM image.

As you already understood, Dism is mainly used to modernize the Windows installation image and further deploy it to a computer, we will definitely tell you about all this in the following articles, and today we will start, so to speak, with the introductory part (the simplest), we will capture it with the help Dism drive (C :), c installed Windows 10 to a WIM image, and then deploy Win 10 from this image to its place (drive C :).

So we have new laptop with UEFI enabled and Windows 10 installed on a GPT disk.

Laptop disk management.

Using the Dism utility, we will capture the drive (C :) with the installed Windows 10 into a WIM image and save it to disk (D :).

If you wish, you can restore your Windows 10 from this image under any circumstances, even if your operating system will not boot, in this case you need to boot the laptop from the AOMEI PE Builder Live CD and recover using the same Dism.

  • Note: Friends, in this way you can get by with the usual Windows 10 bootable USB flash drive, which can be done with this ... Boot the laptop from a bootable USB flash drive, select repair instead of installation, and boot into the Windows Recovery Environment (Windows RE) command prompt. Then on the command linegrab drive (C :) with installed Windows 10 to WIM imageand save it to disk (D :). You can also restore Windows 10 using a bootable USB flash drive, an example and screenshots are given at the end of the article... But I offer you a more convenient tool - Live CD AOMEI PE Builder, it has a graphical management interface and many additional programs that you might find useful.

Boot your Windows 10 laptop from a USB stick.

This flash drive is universal and you can boot any laptop from it, whether it has a UEFI BIOS or a regular BIOS.

In the initial phase of loading, when this window appears, press Enter on the keyboard.

The AOMEI PE Builder Live CD Desktop is loaded.

Click on Windows button Disk Management

In disk management, we see that the drive letters have not been changed, Windows 10 is on disk (C :), and the system backup image will be saved on disk (D :).

Run the command line

and enter the commands:

my-windows.wim: is the name of the Windows 10 WIM disk image (C :).

D: \- the location where the WIM image is saved.

C: \ - a partition with Windows 10 installed.

Operation progress is 100%. The system image has been created.

Windows 10 image is in file my-windows.wim on disk (D :).

Recovery from image

Now let's imagine a situation that our Windows 10 does not boot and we are restoring the operating system from a previously created image.

Boot the laptop from the Live CD AOMEI PE Builder flash drive.

We go into disk management.

And format the drive (C :) with Windows 10 installed.

Disk (C :) is formatted and has no files on it.

We start the command line and enter the commands:

my-windows.wim (with this command we find out the index of the image - index 1)

where d: \ disk with filemy-windows.wim

Dism / apply-image /imagefile:D:\my-windows.wim / index: 1 / ApplyDir: C: \(this command expands the contents of the WIM image to the C drive :)

where d: \ disk with filemy-windows.wim.

1 is the index of the image.

C:- the disk to which the image is deployed.

Progress 100%.

The image is expanded.

We reboot the laptop and enter the restored Windows 10.

How to do the same with a bootable USB flash drive with Windows 10

We boot from the Windows 10 installation flash drive.

In the initial window of the system installation, press the keyboard shortcut "Shift + F10", the command line opens.

We use Dism to capture the disk (C :), with the installed Windows 10 in a WIM image.

We enter essentially the same commands:

diskpart

lis vol (determined with drive letters)

exit (exit from diskpart)

Dism / Capture-Image /ImageFile:D:\my-windows.wim / CaptureDir: C: \ / Name: "Windows"

The WIM image has been created.

Windows recovery 10 of Wim image

diskpart

lis vol (we determine the letters of the sections hard disk, we see that section C :, this is Volume 2)

sel vol 2 (select drive C :)

format fs = NTFS QUICK (format drive C :)

exit (exit diskpart)

Dism / Get-WimInfo / WimFile: d: \ my-windows.wim (with this command we find out the image index - index 1)

Image Servicing, Deployment and Management System ( DISM.exe). DISM.exe Installs, removes, configures, and updates features and packages in offline Windows images and offline Windows Preinstallation Environment (Windows PE) images. The commands and options available for servicing an image depend on the serviced operating system Windows, and whether the image is a stand-alone image or a running operating system. All commands work with the standalone Windows image. Certain commands are available to maintain a running operating system.

Command line parameters DISM are global and can be used with most command line service options. Command line servicing options are individual and cannot be used in conjunction with other command line servicing options. The Windows image is available for servicing after you mount the image or specify a running operating system.

Before servicing an offline Windows image, you must first mount the image. You can use WIM image commands and arguments to mount a Windows image (WIM) for servicing and management. These commands can also be used to display a list of indexes or check the architecture of a mounted image. After updating the image, you must disable it and either accept or discard the changes you made.

Use the commands below to connect, disconnect and poll .wim files. The case is irrelevant when using these parameters. You need to work with the DISM utility from the Command Prompt, launched with administrator access rights.

Let's consider the main command line parameters of the tool DISM.

Before making changes to the image, you need to mount it, this is done with the following command:
 ■ dism / Mount-Image
Syntax:
dism / Mount-Image / ImageFile: wim_path / index: image_index / MountDir: mount_dir
Key / Optimize used to reduce the time it takes to mount an image
Key / CheckIntegrity will abort the mount process if the image is damaged
Key / ReadOnly mounts an image to a folder with read-only permissions (that is, by default, full access rights are set on the mount folder)
for example:

Dism / Mount-Wim /WimFile:C:\install.wim / index: 1 / MountDir: C: \ mount

File C: \ install.wim will be unpacked (mounted) into a directory C: \ mount

 ■ Device driver integration .
This procedure is necessary in cases when you own a computer with non-standard devices (for example, RAID). The DISM utility allows you to integrate drivers from .inf files into an image. For this, the following parameters are used:
Dism / Image: path_to_directory _with_mounted_image / Add-Driver /Driver: path_to_inf-file
for example:
Dism / Image: C: \ mount / Add-Driver /Driver:C:\Drivers\SCSIRAID\ATI\AMDHDC\amdhdc.inf

 ■ dism / Unmount-Image
Used to unmount (unmount) an image from a folder.
Syntax:
dism / Unmount-Image / MountDir: path_to_mounted_image
Key / Commit unmounting (unmounting) an image with commit (saving changes)
Key / Discard unmount (unmount) the image without saving changes)
for example:
dism / Unmount-Image / MountDir: C: \ mount / Commit

 ■ dism / Commit-Image
Used to apply changes from the mounted image folder to the image itself, without unmounting it.
Syntax:
dism / Commit-Image / MountDir: path_to_mounted_image
for example:
dism / Commit-Image / MountDir: C: \ mount
 ■ dism / Remount-Image
It is used to restore the mount of an image to a folder when the connection to it is lost (for example, when disconnecting from network resource or unplugging the removable storage)
Syntax:
dism / Remount-Image / MountDir: path_to_mounted_image
for example:
dism / Remount-Image / MountDir: C: \ mount
 ■ dism / Cleanup-Mountpoints
Used to clean up mount folders after a crash. The command is executed without additional arguments

Pay attention to one of the DISM innovations - the above commands can be applied not only to .wim files, but also to VHD (X) virtual hard drives.

 ■ dism / Get-WimInfo
Displays information about images contained in a .wim file, VHD file, or VHDX file. This command is executed on an unconnected wim file.
Dism / Get-WimInfo /WimFile:C:\install.wim

 ■ dism / List-Image
Displays a list of files and folders in the specified image.
This command line parameter does not apply to virtual files. hard drives(VHD).
Syntax:
dism / List-Image / ImageFile: wim_path / Index: image_index
For example:
dism / List-Image /ImageFile:C:\install.wim / Index: 1
 ■ dism / Delete-Image
Used to remove a specific image from a .wim file
Syntax:
dism / Delete-Image / ImageFile: wim_path / Index: image_index
For example:
dism / Delete-Image /ImageFile:C:\install.wim / Index: 1
 ■ dism / Export-Image
Used to export an image from a .wim file to a new .wim file. At the same time, reindexing is carried out, and, as a result, the image is optimized.
Syntax:
dism / Export-Image (/ SourceImageFile: wim_path | / SourceIndex: image_index / DestinationImageFile: wim_file_path / DestinationName: target_image_name / Compress: (fast | max | none) / Bootable / CheckIntegrity
Key / Compress sets the degree of data compression
Key / CheckIntegrity is used so that the administrator is notified if an error occurs during export

Key / Bootable

 ■ dism / Append-Image
Used to capture an image from the file system and write it to an existing .wim file.
Syntax:
dism / Append-Image / ImageFile: path_to_WIM file / CaptureDir: Source_path_for_image_capture / Name: name of the image to be created / Description: Description / ConfigFile: path_to_configuration_file
Key / Bootable used if the image contains a bootable Windows environment PE
Key / CheckIntegrity is used so that the administrator is notified if an error occurs while adding an image
Key / Verify

Key / Compress

 ■ dism / Capture-Image
Used to capture an image from the file system to a new .wim file
Syntax:
dism / Capture-Image / ImageFile: path_to_WIM file / CaptureDir: Source_path_for_image_capture / Name: name of the image to be created / Description: Description / ConfigFile: path_to_configuration_file
Key / Bootable used if the image contains a bootable Windows PE environment
Key / CheckIntegrity is used to notify the administrator if an error occurs during image capture
Key / Verify used to check for errors in indexing data in an image

Key / Compress indicates the degree of data compression in the image

 ■ dism / Apply-Image
Used to apply an image from a .wim file to the specified path in the file system.
Syntax:
dism / Apply-Image / ImageFile: wim_path / ApplyDir: image_application_path / Index: image_index

Key / CheckIntegrity is used so that the administrator is notified if an error occurs while applying the image