Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
programming4us
Windows 7

Automating the Deployment of Windows 7 : Imaging with the Windows Automated Installation Kit (part 2) - Understanding the Deployment Image Servicing and Management Tool

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
5/17/2011 11:47:43 AM

2. Understanding the Deployment Image Servicing and Management Tool

The Deployment Image Servicing and Management (DISM) tool is also included in the Windows AIK for Windows 7. The primary benefit of DISM is its ability to modify the contents of an image hosted within a .wim file. This is referred to as offline servicing.

Earlier versions of the Windows AIK required the use of several tools including the Pkgmgr.exe, Intlcfg.exe, and PEimg.exe tools. The DISM tool provides all of the functionality for these tools in a single tool.

DISM is a command-line tool and includes a rich set of switches. If you understand how the ImageX command works with the images as described in the previous section, the DISM tool is easier to grasp. Interestingly, the DISM switches follow the verb-noun format used in Windows PowerShell.

As an example, the get verb is combined with the wiminfo noun in the /get-wiminfo switch. With the verb-noun format, the switches become easy to figure out just by looking at them.

You can access the DISM application via the Deployment Tools Command Prompt by selecting Start => All Programs => Microsoft Windows AIK => Deployment Tools Command Prompt. You'll need administrative permissions when running DISM, so you'll need to right-click the Deployment Tools Command Prompt and select Run As Administrator.

When any of the DISM switches needs to work with a .wim file, it is often specified with the /wimfile switch. The /wimfile switch takes the form of /wimfile:drivePath\filename. For example, an image named image.wim in the C:\images folder would be specified as

/wimfile:c:\images\image.wim

You'll see this used in many commands mentioned in this section. As an example, the /Get-WimInfo switch is used to get information about a .wim file with this full command:

DISM /Get-WimInfo /wimfile:c:\images\image.wim

2.1. Using DISM Get Commands

Many of the get switches are used to retrieve information. Table 1 shows some of the DISM get switches you're likely to use.

Table 1. DISM get switches
SwitchDescription
/Get-HelpDisplays help for DISM.
/Get-WiminfoDisplays information on the images within a .wim file. dism /get-wiminfo /wimfile:g:\sources \install.wim
/Get-MountedWiminfoDisplays information on any images that have been mounted. This includes whether it is in read/write mode and the current status. dism /get-mountedwiminfo

2.2. Using DISM to Mount and Unmount Images

Images must be mounted before you can do any offline servicing. Although you saw earlier that you can use ImageX to mount and unmount images, you can also use DISM.

Table 2 shows some of the commands that can be used to mount, commit, and unmount images.

Table 2. DISM mount switches
SwitchDescription
/Mount-WimMounts an image to a specified directory. The format is Dism /Mount-Wim /WimFile:C:\images\install.wim /index:1 /MountDir:C:\Mount /ReadOnly/ReadOnly switch is omitted to mount the image in read/write mode. The
/Unmount-WimUnmounts the image. The /commit switch is used to write the changes to the image, and the /discard switch does not write the changes. Dism /UnMount-Wim /MountDir:C:\Mount /commit
/Commit-WimCommits the changes to the image but does not unmount the image. Dism /commit Mount-Wim /MountDir:C:\Mount /commit

2.3. Using DISM with Packages and Features

DISM can be used to install, remove, or update Windows packages to an image and manipulate installed features. Packages can be either cabinet (.cab) or Windows Update Stand-alone Installer (.msu) files and are used to distribute software updates, service packs, and language packs.

You can add many common packages to Windows PE images to extend the capabilities of the image depending on what is needed when the PE is booted. These include the following:


WinPE-HTA.cab

This installs HTML application support.


WinPE-Scripting.cab

This adds support for the Windows Scripting Host (WSH), which can be used to execute script files.


WinPE-WMI.cab

This installs support for Windows Management Instrumentation.


WinPE-WDS-Tools.cab

This installs the Windows Deployment Services tools package.

When adding packages with DISM, the package names need to match the exact case of the package. For example, WinPE-WDS-Tools.cab will not work if entered as winpe-wds-tools.cab. However, the case doesn't matter for the DISM commands. For example, DISM /GET-HELP is interpreted the same as Dism /Get-Help.


You can also add packages to regular image files (not only the PE image files). For example, drivers and applications can be added as a package to an offline image.

Table 3 shows some of the DISM switches used to add and remove different elements to an image. Each of these switches is executed against a mounted image, so the /image switch must be used within the command.

Table 3. DISM package and feature switches
SwitchDescription
/Add-PackageUse this to add a package to a mounted image. Dism /image:C:\mount /Add-Package /PackagePath:C:\packages\package.cab
/Remove-PackageUse this to remove a cabinet file package from a mounted image. Dism /image:C:\mount /Remove-Package /PackagePath:C:\packages\package.cab
/Get-PackagesThis will display information about all packages in the mounted image. Dism /image:C:\mount /Get-Packages
/Get-FeaturesThis will display a list of features that are enabled in the mounted image. Dism /Image:C:\mount /Get-Features
/Get-FeatureInfoThis will provide details on any specific feature. For example, the following command provides additional details on the installed games. The StateEnabled or Disabled. dism /image:c:\mount /Get-featureinfo /FeatureName:InboxGames property will be
/Disable-featureFeatures can be disabled using the /Disable-feature switch. The /FeatureName needs to be entered as shown in the Get-Features result. The following command will disable the default games on the image. dism /image:c:\mount /Disable-feature /FeatureName:InboxGames
/Enable-featureDisabled features can be enabled using this switch. The following command will enable the default games on the image. dism /image:c:\mount /Enable-feature /FeatureName:InboxGames


Exercise: Exploring an Image with DISM

  1. Launch the Deployment Tools Command Prompt with administrative permissions. Select Start => All Programs => Microsoft Windows AIK, right-click the Deployment Tools Command Prompt, and select Run As Administrator.

  2. If prompted by User Account Control, click Yes to continue.

  3. Determine the drive letter where your installation DVD is installed. You will substitute this drive letter for each of the commands instead of the letter x.

  4. View a listing of images in the install.wim file with the following command. Use the drive assigned to your DVD instead of the letter x.

    dism /get-wiminfo /wimfile:x:\sources\install.wim

  5. Create a directory to which you'll mount the folder with the following command:

    md c:\mount

  6. Mount the install.wim file in the c:\mount folder with the following command:

    DISM /mount-wim /wimfile:x:\sources\install.wim /index:1 /mountDir:c:\mount /ReadOnly


    If you wanted to modify the image, you would omit the /ReadOnly switch.

  7. View details on the mounted image with the following command:

    DISM /Get-MountedWimInfo

  8. View a list of the packages currently installed on the image with this command:

    DISM /image:c:\mount /Get-Packages

    Once you have mounted an image, you can refer to it using DISM with the /image:path switch. The path is the actual path where it was mounted. In the previous example, it was mounted to the c:\mount directory.

  9. Retrieve a list of features available in the mounted image with the following command:

    DISM /image:c:\mount /Get-features

  10. Disable the games feature within the image with the following command:

    DISM /image:c:\mount /Disable-feature /FeatureName:InboxGames

  11. Verify that the current state of InboxGames has been changed to disabled with the following command:

    DISM /image:c:\mount /Get-featureInfo /FeatureName:InboxGames

  12. Unmount the image using the following command:

    DISM /Unmount-Wim /mountdir:c:\mount /discard

    Because the image was mounted in read-only mode, the changes cannot be committed. However, if the image was mounted in read/write mode, the /commit switch could be added to commit the changes to the image when it is unmounted.



Other -----------------
- Automating the Deployment of Windows 7 : Choosing a Deployment Strategy
- Automating the Deployment of Windows 7 : Understanding and Designing Images
- Planning for the Installation of Windows 7 : Planning and Managing Client Licensing and Activation (part 2)
- Planning for the Installation of Windows 7 : Planning and Managing Client Licensing and Activation (part 1)
- Planning for the Installation of Windows 7 : Virtualization Considerations (part 3) - Installing Integration Components
- Planning for the Installation of Windows 7 : Virtualization Considerations (part 2) - Windows XP Mode
- Planning for the Installation of Windows 7 : Virtualization Considerations (part 1) - Considering a VDI Environment
- Planning for the Installation of Windows 7 : Designing User State Migration
- Planning for the Installation of Windows 7 : Local Installation
- Planning for the Installation of Windows 7 : Choosing a Windows 7 Edition
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server