More

    Why DISM is the Swiss Army knife of Windows maintenance

    Windows’ built-in Deployment Image Servicing and Management command-line device, a.ok.a. DISM, has been round since Windows Vista, when it was first launched as a way for creating and managing Windows photos primarily based on the Windows picture (.wim) file format. It additionally works with the encrypted and compressed Electronic Software Download (.esd) file format launched in Windows 8.1. DISM hasn’t modified a lot because it emerged in 2014, and (largely) works the identical for each Windows 10 and 11.In the context of the DISM utility’s identify, “servicing” is a broad time period protecting a variety of capabilities, from capturing a disk partition and making a disk picture from its contents to mounting and modifying a disk picture. My personal current use of DISM with Windows 10 and 11 has centered round day-to-day system maintenance and upkeep. I’ll talk about the next DISM duties on this article:
    Installing Windows updates from the Microsoft Update Catalog or different package deal file sources
    Repairing a Windows 10 or 11 picture
    Cleaning up the Windows part retailer to reclaim disk area
    Identifying Windows photos, installers, and ISO information
    Identifying and altering worldwide settings in Windows photos
    To use DISM for any of those duties, you’ll have to open an administrative command immediate or an administrative PowerShell session. (Type both cmd or powershell within the Windows search field, right-click Command Prompt or Windows PowerShell within the listing of outcomes, choose Run as administrator, and enter a password if prompted.)Using DISM to put in Windows updatesMy article about putting in Windows updates with DISM explains methods to use the dism /Add-Package possibility to put in Catalog or different updates in .cab or .msu codecs right into a focused Windows picture. This process turns out to be useful when Windows Update isn’t working correctly or for managing large-scale or distant deployments. Essentially, it’s a means so as to add updates to a Windows picture, a method generally known as “slipstreaming.” Please seek the advice of that story for all the main points.Repairing a Windows 10 or 11 picture utilizing DISMIn my article entitled “How to repair Windows 10 (and 11) in 4 steps,” I element my go-to set of steps for fixing misbehaving Windows methods. Step 1 offers with utilizing DISM to test and scan the well being of a Windows picture and restore it to well being utilizing the /checkhealth, /scanhealth, and /restorehealth switches for DISM’s /cleanup-image possibility.Figure 1 exhibits some details about these instructions; please learn my Windows restore story for step-by-step directions and explanations. Ed Tittel / IDG

    Figure 1: Selected DISM /on-line /cleanup-image assist choices in Windows 11. (Click picture to enlarge it.)

    Cleaning up the Windows part retailer with DISMThe WinSxS folder shops Windows part retailer information, which assist Windows updates and customizations. As updates get added to Windows over time, an entry will get saved within the Windows part retailer for every such replace along with the parts already current. This signifies that a certain quantity of litter is inevitable, the place new parts reside alongside older ones they might have made out of date.DISM gives a few methods to take away such litter. The first identifies and deletes earlier variations of replace parts from the Windows part retailer with two instructions: dism /on-line /cleanup-image /analyzecomponentstoredism /on-line /cleanup-image /startcomponentcleanupFigure 2 exhibits the entire operation. Note that I run /analyzecomponentstore as soon as originally to point out a reclaimable package deal, then run /startcomponentcleanup to do the cleanup, then /analyzecomponentstore once more to point out no remaining reclaimable packages and the ensuing footprint modifications. Ed Tittel / IDG

    Figure 2: Before and after evaluation exhibits reported measurement financial savings of two.16GB and on-disk financial savings of 1.81GB after reclaiming two packages from the part retailer. (Click picture to enlarge it.)

    The instance in Figure 2 solely cleans out two reclaimable packages, however after a Patch Tuesday that features a number of replace parts, I’ve seen as many as 5 or 6 reclaimable packages present up when analyzing the part retailer. After working the corresponding clean-up operation, I’ve seen reductions of as much as 6GB of disk area. I’ve gotten within the behavior of working this operation as soon as a month on my Windows PCs to maintain the part retailer slimmed down. Savings of roughly 2 to 4GB are typical.There’s one other variation on the identical syntax as proven within the previous instance with an added possibility:dism /on-line /cleanup-image /startcomponentcleanup /resetbaseThis removes all outmoded variations of each part within the part retailer. Admins or energy customers in the hunt for a “deep clean” can use this syntax as a substitute of the previous, easier cleanup as long as they perceive a ensuing potential complication: Existing replace packages can now not be uninstalled after this command is executed (although new replace installs can proceed as all the time). In different phrases, don’t elect this selection until you’re keen to freeze the package deal lineup in your Windows picture going ahead. FWIW, this has by no means triggered me any issues on over 100 PCs I’ve labored with since DISM got here alongside within the Windows 8 period.Figure 3 exhibits the decidedly modest outcomes that /resetbase delivers on an already clear take a look at machine (0.14GB reported measurement, 0.13GB precise measurement). On a PC with reclaimable packages, it can enhance area reclamation by about 10% to 20%. Ed Tittel / IDG

    Figure 3: Running /resetbase on an already-clean PC makes little distinction. (Click picture to enlarge it.)

    On standalone PCs, there’s little purpose to make use of DISM’s /resetbase possibility. It most likely makes essentially the most sense for curated photos destined for deployment.Microsoft Learn has extra details about the WinSxS folder and Windows part retailer.Identifying Windows photos, installers, and ISO information with DISMIf you’re employed with a number of variations of Windows, you could end up taking a look at an installer or OS picture with out having the ability to inform what’s what. Though it received’t work on working Windows photos, DISM can inform you a good quantity about WIM and ESD information you may need mendacity round.If you run:dism /get-wiminfo /wimfile “target”the place you utilize a legitimate path specification for a goal file, it can present you all the assorted parts listed in that file by quantity. For instance, I used:dism /get-wiminfo /wimfile:”D:sourcesinstall.esd” /index:6on a USB flash drive upon which I’d deposited a Windows 11 installer with out labeling it clearly sufficient. The /index:6 change specifies the Windows 11 Pro stuff contained in the set up.esd picture file. Figure 4 exhibits the end result. Ed Tittel / IDG

    Figure 4: Here’s the information concerning the Windows 11 Pro subset inside the goal set up.esd picture file: model 22621 (22H2) final up to date on 4/11/2023. (Click picture to enlarge it.)

    You can use DISM’s /get-wiminfo capabilities to find out what model of Windows the installer is for, and what editions (Home, Pro, and so forth) it consists of. This will be fairly useful for the installer UFDs that the Microsoft Media Creation Tool creates. Because they’re all named ESD-USB, the added information makes all of the distinction.Identifying and altering worldwide settings in Windows photos with DISMLooking on the backside of Figure 4, you possibly can see the Windows Pro picture parts use American English (ISO language code en-US). If you wish to restore a Windows picture utilizing DISM, the supply materials for each restore and the goal photos have to be an identical — identical OS, identical bittedness (x86 or x64), identical default language.At some level in my checkered profession with Windows 10 or 11 I apparently downloaded and put in the UK language model (en-GB) on considered one of my PCs, most likely by means of an ill-chosen MSDN obtain. As I encountered mysterious issues in getting /restorehealth to work on that machine (which drove me bonkers for some time), it step by step dawned on me that my downside wasn’t a lack of know-how of the DISM command. Rather, the difficulty was that I used to be making an attempt to make use of an American English (en-US) picture to restore a British English (en-GB) set up. Doesn’t work, so don’t trouble making an attempt. Instead, be certain that restore and goal photos are the identical OS model, bittedness, and language.Had I recognized then what I do know now about DISM, I might’ve gotten to the underside of issues a lot sooner. To test the worldwide settings for a Windows picture, one makes use of the /Get-Intl attribute. For a web based (working) picture, the syntax is:dism /on-line /Get-IntlSpecifying an offline picture requires utilizing the /Image attribute, with a path specification to the picture file you want to look at. Figure 5 exhibits the /Get-Intl outcomes for a web based picture with en-GB because the default language. Ed Tittel / IDG

    Figure 5: The /Get-Intl attribute exhibits language settings (useful when utilizing languages apart from en-US). (Click picture to enlarge it.)

    I found this discrepancy when putting in an replace to Windows and observing that the keyboard behaved like a UK mannequin as a substitute of a US mannequin. This led me to alter the fallback language to American English (en-US) and to alter my locale to the USA, after which these issues vanished.This DISM command helps altering the put in language, but it surely solely works on an offline picture. To make that change, I’d must boot to a restoration picture, then navigate to the put in picture file on this machine and carry out a sequence of instructions involving /Set-UILang, /Set-UILangFallback, /Set-UserLocale, and /SetInputLocale. See Microsoft Learn for all these particulars.Dig deeper into DISMAlthough these examples embody a good variety of capabilities in DISM, it is just the start of what you are able to do with this highly effective and succesful device. For occasion, Microsoft Learn has tutorials for utilizing DISM to:The extra you dig into DISM, the extra you will discover to love about it. That’s why the DISM Reference at Microsoft Learn ought to be in your favorites listing or in your browser bookmarks. You may discover a number of nice, step-by-step tutorials on working with DISM at ElevenForum.com, particularly “Repair Windows Image Component Store in Windows 11.” (Here’s the Windows 10 equal.) Enjoy!This article was initially printed in February 2016 and up to date in June 2023.

    Copyright © 2023 IDG Communications, Inc.

    Recent Articles

    Poor Reception on Your iPhone or Android? Here's What You Can Do

    Like it or not, your telephone is a lifeline to the world. There are days the place poor reception simply makes it tougher so...

    Google Pixel 8a vs. Pixel 8 Pro

    A less expensive various  For those that have been ready for a less expensive various to the Google Pixel 8 Pro and Google Pixel 8,...

    Two new games prove that Soulslikes can be approachable | Digital Trends

    Sony Interactive Entertainment One of my favourite copypastas on the web comes from somebody complaining a couple of participant utilizing mods to make a FromSoftware...

    SanDisk Desk Drive USB SSD review: High capacity, 10Gbps performance

    At a lookExpert's Rating ProsAvailable in massive 4TB and 8TB capacitiesGood 10Gbps performerAttractive and weird, if considerably massive, heat-shedding designOur VerdictMore capability is at all...

    SK Hynix Tube T31 review: Looks like a USB drive, performs like a SSD

    At a lookExpert's Rating ProsFast like an exterior SSDDecently inexpensiveSmall kind issueCaptive Type-A USB connectorCons Costs greater than the frequent thumb driveOur VerdictSK Hynix’s Tube...

    Related Stories

    Stay on op - Ge the daily news in your inbox