- Enable or Disable Windows Features Using DISM
- To mount an offline image for servicing
- To find available Windows features in an image
- To enable Windows features
- To restore removed Windows features
- To disable Windows features
- To remove Windows features for on-demand installation
- To enable or disable Windows features by using DISM and an answer file
- To commit changes on an offline image
- Get-Windows Optional Feature
- Syntax
- Description
- Examples
- Example 1: Lists optional features in the running operating system
- Example 2: Lists optional features in a package in a mounted image
- Example 3: Get details about a feature in a mounted image
- Example 4: Gets details about a feature in a specified package in a mounted image
- Example 5: Gets details about features using a wildcard
- Parameters
- Empty List in Turn Windows Features On or Off (OptionalFeatures.exe)
Enable or Disable Windows Features Using DISM
The Deployment Image Servicing and Management (DISM) tool is a command-line tool that is used to modify WindowsВ® images. You can use DISM to enable or disable Windows features directly from the command prompt, or by applying an answer file to the image. You can enable or disable Windows features offline on a WIM or VHD file, or online on a running operating system.
To mount an offline image for servicing
Open a command prompt with administrator privileges.
To use DISM from an installation of the Windows Assessment and Deployment Kit (WindowsВ ADK), locate the WindowsВ ADK servicing folder and navigate to this directory. By default, DISM is installed at C:\Program Files (x86)\Windows Kits\10.0\Assessment and Deployment Kit\Deployment Tools\ in WindowsВ 10, C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\ in WindowsВ 8.1and C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\ in WindowsВ 8.
DISM is available in:
- WindowsВ 10
- WindowsВ 8.1
- WindowsВ 8
- Windows ServerВ 2016 Technical Preview
- WindowsВ Server 2012 R2
- Windows ServerВ 2012
- Windows Preinstallation Environment (WinPE) for WindowsВ 10
- WinPE 5.0
- WinPEВ 4.0
You can install DISM and other deployment and imaging tools, such as Windows System Image Manager (WindowsВ SIM), on another supported operating system from the WindowsВ ADK. For more information, see DISM Supported Platforms.
Use the /Get-ImageInfo option to retrieve the name or index number for the image that you want to modify. An index or name value is required for most operations that specify an image file.
For example, at the command prompt type:
Mount the offline Windows image. For example, type:
To find available Windows features in an image
List all of the features available in the operating system. For example, type:
To service an offline image, specify the location of the mounted image directory. For example, type:
You can use >featurelist.txt to redirect the output of the command to a text file that is named featurelist.
Review the list of features to find the feature that you want to enable, disable, remove, or restore.
Use /Get-FeatureInfo to list information about the specific feature you are interested in. For example, type:
To enable Windows features
Enable a specific feature in the image. You can use the /All argument to enable all of the parent features in the same command. For example, type:
To service an offline image, specify the location of the mounted image directory. For example, type:
Optional: Get the status of the feature you have enabled. For example, type:
If the status is Enble Pending, you must boot the image in order to enable the feature entirely.
To restore removed Windows features
Enable a specific feature in the image. If you do not specify a source, DISM will look in the default location specified by group policy for the required files needed to enable the feature For more information, see Configure a Windows Repair Source.
If the files are not found in the default location, DISM will contact Windows Update (WU) for the required files. You can use the /LimitAccess argument to prevent DISM from contacting WU.
If you specify multiple /Source arguments, the files are gathered from the first location where they are found and the rest of the locations are ignored.
For example, type:
To service an offline image, specify the location of the mounted image directory. For example, type:
Optional: Get the status of the feature you have enabled. For example, type:
If the status is EnablePending, you must boot the image in order to enable the feature entirely.
To disable Windows features
Disable a specific feature in the image. For example, type:
To service an offline image, specify the location of the mounted image directory. For example, type:
Optional: Use DISM /GetFeatureInfo to get the status of the feature you have disabled. For example, type:
If the status is DisablePending, you must boot the image in order to disable the feature entirely.
To remove Windows features for on-demand installation
Remove a specific feature in the image without removing the feature’s manifest from the image. This option can only be used when servicing WindowsВ 10, WindowsВ 8.1, WindowsВ 8, Windows ServerВ 2016 Technical Preview, WindowsВ Server 2012 R2, or Windows ServerВ 2012. For more information, see Configure a Windows Repair Source.
For example, type:
To service an offline image, specify the location of the mounted image directory. For example, type:
Optional: Use DISM /GetFeatureInfo to get the status of the feature you have disabled. For example, type:
The status is Disabled. Beginning with Windows 10, the payload is not removed from Windows client SKUs in order to support push-button reset. The payload is removed from Windows Server SKUs.
To enable or disable Windows features by using DISM and an answer file
In WindowsВ SIM, open an existing catalog by clicking Select a Windows Image on the File menu and specifying the catalog file type (.clg) in the drop-down list, or create a new catalog by clicking Create Catalog on the Tools menu.
Expand the catalog in the Windows Image pane, and then expand Packages.
Expand Foundation, and right-click Microsoft-Windows-Foundation-Package.
Click Add to Answer File.
Click Enabled or Disabled next to the features that you intend to enable or disable. Click the arrow to select the opposite choice.
You might have to expand an item to see all its children. You must enable the parent if any one of its children are enabled.
NoteВ В You can’t restore or remove a Windows feature for features on demand with an unattended answer file.
Click Tools on the main menu, and then click Validate Answer File.
Correct any errors that appear in the Messages pane, and save the answer file.
At the command prompt, type the following command to apply the unattended answer file to the image.
To service an offline image, specify the location of the mounted image directory. For example, type:
To commit changes on an offline image
Commit the changes and unmount the image. For example, type:
Get-Windows Optional Feature
Gets information about optional features in a Windows image.
Syntax
Description
The Get-WindowsOptionalFeature cmdlet gets information about all features (operating system features that include optional Windows foundation features) in the Windows Foundation Package or a specified package in the Windows image.
Use the PackageName or PackagePath parameter to get information about all features in a specific package in the Windows image.
The FeatureName parameter gets more detailed information about a specific feature in the Windows image. If the feature is not a part of the Windows Foundation package, either a PackageName or PackagePath parameter must be used to specify the parent package of the feature.
Use the Online parameter to specify the running operating system on your local computer, or use the Path parameter to specify the location of a mounted Windows image.
Examples
Example 1: Lists optional features in the running operating system
This command lists all of the optional features in the running Windows operating system.
Example 2: Lists optional features in a package in a mounted image
This command displays lists all of the optional features in the specified package in the Windows image mounted to c:\offline.
Example 3: Get details about a feature in a mounted image
This command displays detailed information about the feature, Hearts, in the Windows Foundation Package in the Windows image mounted to c:\offline.
Example 4: Gets details about a feature in a specified package in a mounted image
This command displays detailed information about the feature, MyFeature, in the package at c:\package\package.cab in the Windows image mounted to c:\offline.
Example 5: Gets details about features using a wildcard
This command returns details about the Hyper-V optional features in the running operating system by use of a wild card feature name.
Parameters
Specifies the name of a feature to get detailed information about. Feature names are case sensitive if you are servicing a Windows image other than Windows 8.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | True |
Specifies the maximum output level shown in the logs. The default log level is 3. The accepted values are as follows:
- 1 = Errors only
- 2 = Errors and warnings
- 3 = Errors, warnings, and information
- 4 = All of the information listed previously, plus debug output
Type: | LogLevel |
Aliases: | LL |
Accepted values: | Errors, Warnings, WarningsInfo |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the full path and file name to log to. If not set, the default is %WINDIR%\Logs\Dism\dism.log . In Windows PE, the default directory is the RAMDISK scratch space which can be as low as 32 MB. The log file will automatically be archived. The archived log file will be saved with .bak appended to the file name and a new log file will be generated. Each time the log file is archived the .bak file will be overwritten. When using a network share that is not joined to a domain, use the net use command together with domain credentials to set access permissions before you set the log path for the DISM log.
Type: | String |
Aliases: | LP |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies that the action is to be taken on the operating system that is currently running on the local computer.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the name of a package as it is listed in the Windows image. Use the PackageName parameter to get all of the features in the package. Use the FeatureName and PackageName parameters to get more detailed information about a specific feature in the package.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the location of a .cab file in the Windows image. Use the PackagePath parameter to get all of the features in the package. Use the FeatureName and PackagePath parameters to get more detailed information about a specific feature in the package.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the full path to the root directory of the offline Windows image that you will service. If the directory named Windows is not a subdirectory of the root directory, WindowsDirectory must be specified.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies a temporary directory that will be used when extracting files for use during servicing. The directory must exist locally. If not specified, the \Windows\%Temp% directory will be used, with a subdirectory name of a randomly generated hexadecimal value for each run of DISM. Items in the scratch directory are deleted after each operation. You should not use a network share location as a scratch directory to expand a package (.cab or .msu file) for installation. The directory used for extracting files for temporary usage during servicing should be a local directory.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the path to the location of the BootMgr files. This is necessary only when the BootMgr files are located on a partition other than the one that you are running the command from. Use -SystemDrive to service an installed Windows image from a Windows PE environment.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the path to the Windows directory relative to the image path. This cannot be the full path to the Windows directory; it should be a relative path. If not specified, the default is the Windows directory in the root of the offline image directory.
Empty List in Turn Windows Features On or Off (OptionalFeatures.exe)
Running Vista Home Premium x64 SP2. HP box with AMD 64 X2 Dual Core 2.6 Ghz and 4 GB RAM.
Turn Windows Features On or Off is blank, whether I access it from «Programs» or the command OptionalFeatures.exe. The original problem was I was unable to do a normal search for files: nothing showed up, although I know the files are there. Steps I took, none of which have worked:
1. Rebuild the index.
2. Go to «Turn Windows Features On or Off» to see if searching or indexing was unchecked, but the window is blank.
3. Ran a SystemRestore, both from Windows, and from Safe Mode. In Windows, I started from the most recent restore, and went as far back as I could, but each time there was no improvement.
4. Ran sfc.exe /scannow. It reported an «unspecified error.»
5. Tried to locate and delete «HKLM\COMPONENTS /v StoreDirty» as suggested on another webpage, but this key does not exist.
6. Ran «System Update Readiness Tool» and followed the instructions at http://www.raymond.cc/blog/archives/2009/03/06/fix-blank-or-empty-list-in-vista-turn-windows-features-on-or-off-optionalfeaturesexe/.
Results of Checksur.log:
=================================
Checking System Update Readiness.
Binary Version 6.0.6002.22359
Package Version 8.0
2010-07-21 11:59
Checking Windows Servicing Packages
Checking Package Manifests and Catalogs
(f) CBS MUM Corrupt 0x00000000 servicing\Packages\Paccage_for_KB955430
6.0.1.18005.mum Expected file name Package_for_KB955430
6.0.1.18005.mum does not match the actual file name
(f) CBS Catalog Missing 0x00000002 servicing\Packages\Paccage_for_KB955430
Checking Package Watchlist
(f) CBS Watchlist Package Missing 0x80070002 Microsoft-Windows-Foundation-Package
6.0.1.18005 Package registry presence failed, possibly an orphaned package on package watchlist
(f) CBS Watchlist Package Missing 0x80070002 Microsoft-Windows-Foundation-Package
6.0.1.18005 Package registry presence failed, possibly an orphaned package on package watchlist
(f) CBS Watchlist Package Missing 0x80070002 Microsoft-Windows-Foundation-Package
6.0.1.18005 Package registry presence failed, possibly an orphaned package on package watchlist
(f) CBS Watchlist Package Missing 0x80070002 Microsoft-Windows-Foundation-Package
6.0.1.0 Package registry presence failed, possibly an orphaned package on package watchlist
(f) CBS Watchlist Package Missing 0x80070002 Microsoft-Windows-ServerCore-Package
6.0.1.18005 Package registry presence failed, possibly an orphaned package on package watchlist
(f) CBS Watchlist Package Missing 0x80070002 Package_1_for_KB937287
6.0.1.18005 Package registry presence failed, possibly an orphaned package on package watchlist
(f) CBS Watchlist Package Missing 0x80070002 Package_1_for_KB937287
6.0.1.18005 Package registry presence failed, possibly an orphaned package on package watchlist
Checking Component Watchlist
Checking Packages
(f) CBS Registry Error 0x80070002 Package_for_KB961371_client_0
6.0.1.4 failed to get CurrentState
(f) CBS Registry Error 0x80070002 Package_for_KB961371_client_0
6.0.1.4 failed to get Visibility
(f) CBS Registry Error 0x80070103 Package_for_KB973540
6.0.1.0 failed to get owner for package.
Checking Component Store
(f) CSI Manifest Failed Catalog Check 0x00000000 winsxs\Manifests\amd64_microsoft-windows-mediaplayer-core_31bf3856ad364e35_6.0.6002.18111_none_6965088104a4a9d3.manifest amd64_microsoft-windows-mediaplayer-core_31bf3856ad364e35_6.0.6002.18111_none_6965088104a4a9d3
(f) CSI Payload File Missing 0x00000000 mtxclu.dll amd64_microsoft-windows-c..dtc-runtime-cluster_31bf3856ad364e35_6.0.6001.18000_none_f2a6eab6450fb329
(f) CSI Payload File Missing 0x00000000 spopk.dll x86_microsoft-windows-sysprep-spopk_31bf3856ad364e35_6.0.6001.18000_none_17b1b4bf4d68607e
(f) CSI Payload File Missing 0x00000000 inetppui.dll amd64_microsoft-windows-p..rnetprinting-client_31bf3856ad364e35_6.0.6000.16386_none_e4ba3f3583d59aa4
(f) CSI Payload File Missing 0x00000000 inetpp.dll amd64_microsoft-windows-p..rnetprinting-client_31bf3856ad364e35_6.0.6000.16386_none_e4ba3f3583d59aa4
(f) CSI Payload File Missing 0x00000000 wpnpinst.exe amd64_microsoft-windows-p..rnetprinting-client_31bf3856ad364e35_6.0.6000.16386_none_e4ba3f3583d59aa4
(f) CSI Payload File Missing 0x00000000 spnet.dll x86_microsoft-windows-sysprep-spnet_31bf3856ad364e35_6.0.6000.16386_none_15895d535064fbd7
(f) CSI Payload File Missing 0x00000000 spwinsat.dll x86_microsoft-windows-sysprep-spwinsat_31bf3856ad364e35_6.0.6000.16386_none_50fdbf058097a590
Summary:
Seconds executed: 1992
Found 20 errors
CSI Manifest Failed Catalog Check Total count: 1
CSI Payload File Missing Total count: 7
CBS MUM Corrupt Total count: 1
CBS Catalog Missing Total count: 1
CBS Registry Error Total count: 3
CBS Watchlist Package Missing Total count: 7
Unavailable repair files:
winsxs\manifests\amd64_microsoft-windows-mediaplayer-core_31bf3856ad364e35_6.0.6002.18111_none_6965088104a4a9d3.manifest
servicing\packages\Paccage_for_KB955430
Customer Experience report successfully uploaded. Thank you for participating. For more information, see the Microsoft Customer Experience Improvement Program on the Microsoft web site.
It looks to me like the obvious error is just a typo. The first error listed says it is looking for «servicing\Packages\Paccage_for_KB955430
6.0.1.18005.mum» but «package» is spelled wrong in the command.
Anyway, I deleted all references to KB955430 in the Packages section of the registry and rebooted. I did this twice. Still not fixed. (I did not delete the reference from the «Sqm» section).
SFC suggets file corruption (that’s what it means if it doesn’t say it completed with no inegrity violations) and the above report shows a whole slew of errors and/or missing files and I’m not quite sure what should or shouldn’t be deleted from the registry based on this report and the information in that article. I don’t think I’d mess around any more with the registry without knowing a whole lot more about what I was doing and what all these entries do and what deleting them will do. If you decide to do so anyway, at least first create a system restore point AND backup the registry just in case. I would also do a full backup of everything I want to save (all my data).
I recommend a aystem repair/upgrade instead of this potentially dangerous registry modification process. You’ve followed all the other procedures and none of hem worked and this one concerns me.
We’ll need to do a system repair/upgrade using the genuine Windows Vista Installation Disk (one you own or one you can borrow from ANYONE). To do this you have to also be able to boot normally. Here’s the procedure: http://www.vistax64.com/tutorials/88236-repair-install-vista.html . Although this will not affect your data, settings, or programs, you should still backup your data before starting just to be on the safe side. You may have a lot of updates to re-install (including any service packs you had to remove). If the version on the system came with SP1 or SP2 pre-installed and the disk is an earlier version, then you’ll need to make a slipstream disk as follows: http://www.vistax64.com/tutorials/151606-vista-sp1-slipstream-installation-dvd.html .
If that doesn’t work (or you don’t have or can’t get your hands on the disk), then I’m afraid the only option is a clean install (or trying the registry procedure since if you’ve backed up and are about to do a clean install anyway, you almost have nothing to lose by trying). You can use Knoppix http://www.knopper.net/knoppix/index-en.html with a good ISO copier like: http://isorecorder.alexfeinman.com/isorecorder.htm along with a blank CD. This should give you enough access to the system (if you can’t get in any other way and I don’t think that’s an issue here so you probably won’t need to make the disk) to backup your important data. Once done, you can do a clean install either using the genuine Windows Vista Installation Disk or the Recovery Disk or the Recovery Partition (whatever process is dictated by your computer manufacturer – you may need to contact them for the procedure and perhaps to get recovery disks). To do a clean install proceed as follows: http://www.winsupersite.com/showcase/winvista_install_03.asp (adapted as necessary by the procedures of your computer manufacturer). Then you will need to re-install all your programs, reset all your preferences, reconfigure your network and email settings, restore your backed up data, run Windows Update with possibly nearly 150 updates pending.
I hope this helps.
Lorien — MCSE/MCSA/Network+/A+ — If this post helps to resolve your issue, please click the «Mark as Answer» or «Helpful» button at the top of this message. By marking a post as Answered, or Helpful you help others find the answer faster.