Thursday, 26 August 2010

Mastering DISM

Windows 7 features a nifty tool called DISM, Deployment Image Servicing and Management tool.
This tool is for systemadministrators, but also for those who hate to use wizards such as the 'Add & Remove Programs' wizard to enable/diable Windows components.

DISM works for VHD files (Windows OS images) but also for the 'online' system, ergo the OS you're using at the moment. That's why you have to use the switch /online if you want to manage the live OS.

Two remarks:

of course you have to use a command line with administrative priviliges!
the featurenames are case sensitive! TelnetClient is not the same as telnetclient!
Some example command lines:
To enable a feature in the online OS.
dism /online /enable-feature /featurename:Name-of-feature
And to disable, use the /disable-feature switch:
dism /online /disable-feature /featurename:Name-of-feature

So, to enable the Telnet client in Windows 7, open up the admin cmd prompt and type:
dism /online /enable-feature /featurename:TelnetClient

Another example, to remove Solitaire use this:
dism /online /disable-feature /featurename:Solitaire

A list of all your current features and their status in your online OS can be obtained by using this command:

dism /online /get-features | more

or outputted to the textfile features.txt.

dism /online /get-features > features.txt


The best thing of DISM is that it also works for offline images, such as WIM images and VHD files, and you can do MUCH MUCH more than just manage Windows components.
Setting the registration key, manage drivers, manage language packs, etc, it's all possible with DISM.

No comments:

Post a Comment