Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Managing Windows 7 with DISM

28 Jul 2009   #1
z3r010

 
Managing Windows 7 with DISM

Quote:
This week I am proud to feature guest blogger Justin Rodino. He is a Microsoft Desktop Experience MVP and a member of our STEP (Springboard Technical Experts Panel) program.  His own blog is available here. This weeks guest blogger topic is on the new DISM tool. A great way to make deploying and maintaining Windows 7 images easier.

What is DISM

DISM – the Deployment Imaging Servicing and Management Tool is a new part of Windows 7 that has been created to help you manage (and deploy) images with greater ease. Previous versions of Windows included tools such as:

  • ImageX – a tool which allowed you to mount offline images
  • Pkgmgr – A device driver and package manager
  • PEImg – A WindowsPE Utility to prepare images once edited with pkgmgr
  • Intlcfg – An International Settings Configuration Tool
All of the above tools have very specific feature sets, but using these makes modifying and changing the created images very cumbersome. The first problem naturally was which tool to use when.  Once you figured this out, you had to go through a series of steps in order to get the image mounted – of which you could only do “offline” – and when completed you had to recompile or re-make the new image you wished to deploy.  With DISM, all of these tools become one and even better – you can do certain things to an “online” or live image.  What we’re going to do is take a quick look at DISM, get some information about our current installation as well as service it, whilst using it.

Starting DISM

The first thing we need to do in order to run DISM is have an elevated command prompt open.  Simply going Start –> Run –> cmd –> Enter won’t do the trick as that runs with user privileges.  What we need to do is either do Start –> Run –> Cmd –> Shift+CTRL+Enter or Click on Start type cmd and when it appear in the search box, right click on it and choose “Run as Administrator”:



Once we’ve got the elevated command prompt open – we can check this by looking in the task bar and the title should be prefixed by “Administrator:



Now if we type “dism” we should get help about dism.  If you get the message:

Error: 740

Elevated permissions are required to run DISM.
Use an elevated command prompt to complete these tasks.

Then you didn’t successfully get a command prompt with elevated privileges open.

Finding Basic Information With DISM

Now that we’ve got our command prompt ready for action, we can find some basic information about the OS we’re currently running. At the prompt type:

dism /online /Get-CurrentEdition

This tells dism we want to use the current version (/online) and the command – similar to PowerShell – tells dism we want to get information about the current edition (/Get-CurrentEdition).  Proving successful the results should return something like:

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Current edition is:

Current Edition : Ultimate

The operation completed successfully.

Now let’s take it one step further.  As there are different versions of Windows 7 available, we have the potential to upgrade.  If we run dism (referencing the online image - /online) with /Get-TargetEditions, it will tell us what versions we can upgrade to (if at all possible).  So, if I run

dism /online /Get-TargetEditions

against a machine that is already running Windows 7 Ultimate, DISM should return:

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Editions that can be upgraded to:

(The current edition cannot be upgraded to any target editions.)

The operation completed successfully.

So, scripting the above can prove useful if we need to interrogate or find information about our existing machine or its capabilities.

Changing the System with DISM

As well as querying the system for information, one of the most powerful features of DISM is its capability to “service” an “online” or live image.  This allows us the capability to change the OS on the fly.  For example, Windows 7 ships with numerous games and features installed that we might not want as part of our corporate build.  Using the functionality built in to DISM – whilst the OS is running – we can remove these features.

First, let’s look at what is installed and what we can change.  To do this, at the prompt we need to type:

dism /online /Get-Features | more

Again, we reference the current version (/online) and we use the command /Get-Features to show us the currently installed features.  The “| more” simply paginates the output so we can see it without having to scroll.  If we look through the list some of the features we want to remove can be seen:

….

Feature Name : FreeCell
State : Enabled

Feature Name : Minesweeper
State : Enabled

Feature Name : PurblePlace
State : Enabled

….

As the state of these currently shows “Enabled” we want to remove or disable them.  Using DISM, we can easily do this.  At the prompt we can type:

dism /online /Disable-Feature /FeatureName:

Where we simply replace with the feature from the list of results we got using /Get-Features.  NOTE: The features are CaSe SEnSItivE.  As an example, if we wanted to remove PurblePlace, we could simply enter:

dism /online /Disable-Feature /FeatureName:PurblePlace

at which time DISM will kick in and should return results like the following:

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Disabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.

Let’s now check to see if it was disabled:

dism /online /Get-FeatureInfo /FeatureName:PurblePlace

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Feature Information:

Feature Name : PurblePlace
Display Name : Purble Place
Description : Purble Place
Restart Required : Possible
State : Disabled

Custom Properties:

(No custom properties found)

The operation completed successfully.

As we can see “State : Disabled” means we’ve disabled it.  Should we want to re-enable it, we can simply type:

dism /online /Enable-Feature /FeatureName:PurblePlace

At which time DISM will put the feature back on the machine in a similar way it removed it:

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.

Conclusion

As you can see DISM is a very powerful tool and the introduction of online/live servicing makes it even more useful to the IT professional.  To get more information about DISM or any of its functions or capabilities, use the /? flag when you get stuck.  Some examples include:

  • “dism /?” – which will tell you about the root level capabilities
  • “dism /online /?” – which will tell you about the online image servicing capabilities
  • “dism /online /Get-Features /?” – which will tell you about the Get-Features function
And from there, the sky’s the limit.  Happy DISM’ing.


More...


My System SpecsSystem Spec
.
28 Jul 2009   #2
Zidane24

Windows 7 Home Premium x64 - Mac OS X 10.6.4 x64
 
 

Quote   Quote: Originally Posted by z3r010 View Post
This is so much better than the way we used to do it to make lite images of 7...or Vista in the past
My System SpecsSystem Spec
28 Jul 2009   #3
garysgold

Vista Ult 64 bit Seven Ult RTM x64
 
 

Thanks John. Having a play with that.

Gary
My System SpecsSystem Spec
.

28 Jul 2009   #4
chev65

Windows 7 Ult, Windows 8.1 Pro,
 
 

How long before an easier to use software version using DISM appears?

7Lite is coming I just know it!
My System SpecsSystem Spec
28 Jul 2009   #5
baarod

El Capitan / Windows 10
 
 

DISM does NOT remove the features it disables. As such it doesn't help with disk space.
My System SpecsSystem Spec
28 Jul 2009   #6
chev65

Windows 7 Ult, Windows 8.1 Pro,
 
 

I thought one of the original feature's was able to prepare images. Still could use a 7lite that could remove those feature's from the .iso's.
My System SpecsSystem Spec
28 Jul 2009   #7
Zidane24

Windows 7 Home Premium x64 - Mac OS X 10.6.4 x64
 
 

Quote   Quote: Originally Posted by baarod View Post
DISM does NOT remove the features it disables. As such it doesn't help with disk space.
Not true...It also removes packages which will save on disk space
My System SpecsSystem Spec
28 Jul 2009   #8
Zidane24

Windows 7 Home Premium x64 - Mac OS X 10.6.4 x64
 
 

Quote   Quote: Originally Posted by chev65 View Post
I thought one of the original feature's was able to prepare images. Still could use a 7lite that could remove those feature's from the .iso's.
nuhi has mentioned in emails that he has no intent at making 7Lite right now
My System SpecsSystem Spec
Reply

 Managing Windows 7 with DISM




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Help with DISM Log
Hello. 1st post :o Noticed dism.exe and dismhost.exe running yesterday. Had not ever noticed them before, so I did some research. I now understand what the utility is, but my question has to do with why dism.exe would run on a PC. I took a look at the DISM log, and I'm not quite sure what...
Performance & Maintenance
dism not working anymore
Hi. i'm trying to make my own win7 install cd with update and so on. i've done a few test before but now i only get error from dism error: 3 Det går inte att hitta sökvägen. Transleted: Can not find the path. all dirs i've tried have no spaces in them tried a few diffrent .wim files...
Customization
Updates not injecting into image using DISM
Is this forum a good place for posting WDS related question? If not please direct me to the correct forum. Thank you. Issue, short version: after running DISM commands to inject updates to the WDS images, we use the image on a box and there are no new updates installed. Only the originally...
Windows Updates & Activation
Trimming down W7HPx64 with RT7lite and DISM
Hi, NB: This is not a thread discussing or advocating piracy or illegal actions, though it may initially appear so. Quite the opposite in fact. I recently installed Tiny7, a stripped-down version of Windows 7 Ultimate x86. Turns out it allows me to run games at significantly greater...
Performance & Maintenance
User Interface: Managing Windows windows
More...
News


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 02:19.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App