Thanks to some clever work from Sergey Tkachenko over at Winaero.com, DISM shows off yet another interesting capability. You can use it to install missing Windows features without having to download them from the Internet (that’s because they’re already part of the Windows image baked into the Windows installer, or other environments that include the ubiquitous install.wim or install.esd file). The syntax for the relevant DISM FeatureName command tells the story, to those in the know, namely:
DISM /Online /Enable-Feature /FeatureName:NetFX3 /All /Source:D:\sources\sxs /LimitAccess
Let’s unpack this command string, to elucidate what’s going, item by item:
/online: operate on the current running version of Windows
/enable-feature: turns OS features on
/featurename: identifies feature name to be turned on, where NetTX3 refers to the current .NET Framework version 3, aka .NET 3.5
/all: turn on all aspects of the feature being enabled
/Source: identifies a file-spec from whence the files should be drawn (\sources\sxs, for install.wim/.esd image)
/LimitAccess: do not download files from the Internet
Here’s the DISM FeatureName command at work (on a pre-release Win10 build).
[Image Credit: Sergey Tkachenko Winaero.com]
What DISM Featurename Values Are Available for Windows 10?
Funny you should ask: DISM can provide that list using the command line DISM /online /Get-Features. By running this command, I was able to interrogate my own running image, and learned that there are 115 such named features, most of which are disabled by default in a standard Windows 10 installation. Any of these that are in a “Disabled” state may be turned on using the same syntax shown above, simply by substituting the desired package name for “NetTX3” in the exploded DISM command already explored and explained.
What Can Go Wrong When Using DISM Featurename Stuff?
In my own experience, and in working with DISM for various other instructions that include the /Source attribute, I’ve learned that this particular attribute can sometimes be finicky. If you try to use the foregoing syntax and get errors related to source locations, you’ll want to dig deep into the TechNet DISM Reference to fully understand its syntax and semantics. In the comments to Tkachenko’s explanatory blog post, for example, half-a-dozen respondents reported trouble with the very nice batch file he provides to automate the process of using DISM to add the .NET 3.5 feature (and one respondent supplies an alternate DISM technique that uses its /Add-Package capability instead of /Enable-Feature).