新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 帮助大家解决各类计算机故障,比如:安装双系统,ADSL上网故障,病毒防火墙,删除3721、木马,上网故障,播放器故障、电脑黑屏、注册表修改等。
    [返回] 中文XML论坛 - 专业的XML技术讨论区休息区『 网友互助 』 → Windows 7企业部署指南之——使用DISM 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 9560 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: Windows 7企业部署指南之——使用DISM 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     卷积内核 帅哥哟,离线,有人找我吗?
      
      
      威望:8
      头衔:总统
      等级:博士二年级(版主)
      文章:3942
      积分:27590
      门派:XML.ORG.CN
      注册:2004/7/21

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给卷积内核发送一个短消息 把卷积内核加入好友 查看卷积内核的个人资料 搜索卷积内核在『 网友互助 』的所有贴子 访问卷积内核的主页 引用回复这个贴子 回复这个贴子 查看卷积内核的博客楼主
    发贴心情 Windows 7企业部署指南之——使用DISM

    DISM.exe是新的命令行工具,在操作系统Windows 7的默认安装中和自动安装工具Windows AIK 2.0中都可以看到该工具的身影。

      注意:以可启动的Windows镜像方式对VHD文件提供支持是Windows 7中出现的一个新功能,我们会在本系列其他文章中对该功能进行介绍。

    按此在新窗口浏览图片

    更多Windows 7企业应用请看【精研细品 Windows 7】

      我们可以使用DISM.exe操作Windows镜像,这其中包括Windows 镜像文件(WIM)和虚拟硬盘文件(VHD)。虽然DISM.exe主要用于操作离线的Windows 镜像,但是它的一些功能也可以用来为在线的Windows操作系统提供管理。我们所说的操作镜像意指添加或删除设备驱动,添加或删除操作系统补丁,添加hotfixes,配置镜像的区域设定以及其他相应操作。DISM还可以用来将Windows镜像更新至不同版本(如从商业版更新至旗舰版),并准备一个Windows PE镜像以供使用。

      我们可以用DISM对以下版本的镜像进行修复:

       ·Windows Vista SP1 及之后版本

       ·Windows Server 2008

       ·Windows 7

       ·Windows Server 2008 R2

      使用DISM

      在Windows Vista(或Windows AIK 1.1)中编辑一个镜像需要使用若干不同的工具。例如我们要在主安装的镜像上安装一个不合常规的设备驱动,如果想在Vista中实现这一操作,要按照以下步骤:

       1.用ImageX装载镜像

       2.用数据包管理器(Pkgmgr.exe)添加设备驱动器

       3.用ImageX卸载镜像

      此外,如果我们的镜像是一个Windows PE镜像,那么还需要使用Windows Preinstallation Environment(PEimg.exe)工具来配置该镜像。最后,如果需要修改镜像的语言和本地设置,我们还要使用International Settings Configuration Tool(Intlcfg.exe)。

      但是,如果要在Windows 7中完成这一操作,要怎么办呢?DISM.exe现在已经取代了早前Windows AIK 1.1版本中的Pkgmgr.exe,Intlcfg.exe和PEimg.exe工具。另外,DISM还包括装载和卸载镜像的功能,因此我们可以对镜像进行编辑。

      通常,我们利用DISM把某个设备驱动添加到离线的Windows 镜像中,然后再将该镜像部署到需要这一驱动的硬件上。让我们浏览一遍完成该操作的命令行以便学习如何使用DISM。

      首先,在我们的Windows AIK 2.0电脑上的C:\Images 文件夹中可以找到一个用于Windows 7的Windows安装镜像(install.wim文件):

      

    C:\Program Files\Windows AIK\Tools\PETools>dir C:\Images

    Volume in drive C has no label.

    Volume Serial Number is 1C9A-D699

    Directory of C:\Images

    05/03/2009  12:46 PM    <DIR>          .

    05/03/2009  12:46 PM    <DIR>          ..

    04/22/2009  07:28 AM     2,218,242,699 install.wim

                   1 File(s)  2,218,242,699 bytes

                   2 Dir(s)  180,411,486,208 bytes free


       收藏   分享  
    顶(0)
      




    ----------------------------------------------
    事业是国家的,荣誉是单位的,成绩是领导的,工资是老婆的,财产是孩子的,错误是自己的。

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2010/7/20 15:34:00
     
     卷积内核 帅哥哟,离线,有人找我吗?
      
      
      威望:8
      头衔:总统
      等级:博士二年级(版主)
      文章:3942
      积分:27590
      门派:XML.ORG.CN
      注册:2004/7/21

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给卷积内核发送一个短消息 把卷积内核加入好友 查看卷积内核的个人资料 搜索卷积内核在『 网友互助 』的所有贴子 访问卷积内核的主页 引用回复这个贴子 回复这个贴子 查看卷积内核的博客2
    发贴心情 
    使用DISM查看镜像

    下面,在 C:\Drivers 文件夹下是Microsoft LifeCam硬件的Windows 7 beta驱动程序(version 2.91):

    C:\Program Files\Windows AIK\Tools\PETools>dir C:\Drivers

    Volume in drive C has no label.

    Volume Serial Number is 1C9A-D699

    Directory of C:\Drivers

    05/03/2009  01:19 PM    <DIR>          .

    05/03/2009  01:19 PM    <DIR>          ..

    05/03/2009  01:19 PM    <DIR>          VX6000

                   0 File(s)              0 bytes

                   3 Dir(s)  180,411,486,208 bytes free


      我们要把镜像装载到名为C:\Servicing的空文件夹中。先让我们使用带有 /get-wiminfo 参数的DISM.exe命令行来显示包含在install.wim文件中的所有Windows镜像。记住,一个安装镜像可以包含一个以上的Windows镜像。

    C:\Program Files\Windows AIK\Tools\PETools>dism /get-wiminfo /wimfile:C:\Images\install.wim

    Deployment Image Servicing and Management tool

    Version: 6.1.7100.0

    Details for image : C:\Images\install.wim

    Index : 1

    Name : Windows 7 STARTER

    Description : Windows 7 STARTER

    Size : 7,927,317,234 bytes

    Index : 2

    Name : Windows 7 HOMEBASIC

    Description : Windows 7 HOMEBASIC

    Size : 7,983,232,406 bytes

    Index : 3

    Name : Windows 7 HOMEPREMIUM

    Description : Windows 7 HOMEPREMIUM

    Size : 8,422,988,972 bytes

    Index : 4

    Name : Windows 7 PROFESSIONAL

    Description : Windows 7 PROFESSIONAL

    Size : 8,303,245,818 bytes

    Index : 5

    Name : Windows 7 ULTIMATE

    Description : Windows 7 ULTIMATE

    Size : 8,461,373,562 bytes

    The operation completed successfully.

    ----------------------------------------------
    事业是国家的,荣誉是单位的,成绩是领导的,工资是老婆的,财产是孩子的,错误是自己的。

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2010/7/20 15:35:00
     
     卷积内核 帅哥哟,离线,有人找我吗?
      
      
      威望:8
      头衔:总统
      等级:博士二年级(版主)
      文章:3942
      积分:27590
      门派:XML.ORG.CN
      注册:2004/7/21

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给卷积内核发送一个短消息 把卷积内核加入好友 查看卷积内核的个人资料 搜索卷积内核在『 网友互助 』的所有贴子 访问卷积内核的主页 引用回复这个贴子 回复这个贴子 查看卷积内核的博客3
    发贴心情 
    使用DISM加载镜像

    现在,假设我们即将部署Windows 7 专业版,在此案例中,从上面的命令行中可以看出,在这一特定镜像中,Index数为4。因此,让我们利用DISM.exe命令中的 /mount-wim 参数把这一特定Windows镜像加载到空的C:\Servicing 文件夹中。

    C:\Program Files\Windows AIK\Tools\PETools>dism /mount-wim /wimfile:C:\Images\install.wim /index:4 /mountdir:C:\Servicing

    Deployment Image Servicing and Management tool

    Version: 6.1.7100.0

    Mounting image

    [==========================100.0%==========================]

    The operation completed successfully.


      使用/get-mountedinfo 参数可以查看镜像是否已经正确加载:

    C:\Program Files\Windows AIK\Tools\PETools>dism /get-mountedwiminfo

    Deployment Image Servicing and Management tool

    Version: 6.1.7100.0

    Mounted images:

    Mount Dir : C:\Servicing

    Image File : C:\Images\install.wim

    Image Index : 4

    Mounted Read/Write : Yes

    Status : Ok

    The operation completed successfully.


      如果我们查看C:\Servicing 目录的内容,就会看到已加载镜像的文件和目录。

    C:\Program Files\Windows AIK\Tools\PETools>dir C:\Servicing

    Volume in drive C has no label.

    Volume Serial Number is 1C9A-D699

    Directory of C:\Servicing

    04/22/2009  03:36 AM    <DIR>          .

    04/22/2009  03:36 AM    <DIR>          ..

    03/20/2009  10:42 AM                24 autoexec.bat

    03/20/2009  10:42 AM                10 config.sys

    04/22/2009  01:17 AM    <DIR>          PerfLogs

    04/22/2009  05:26 AM    <DIR>          Program Files

    04/22/2009  03:27 AM    <DIR>          Users

    04/22/2009  05:29 AM    <DIR>          Windows

                   2 File(s)             34 bytes

                   6 Dir(s)  180,321,382,400 bytes free

    ----------------------------------------------
    事业是国家的,荣誉是单位的,成绩是领导的,工资是老婆的,财产是孩子的,错误是自己的。

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2010/7/20 15:36:00
     
     卷积内核 帅哥哟,离线,有人找我吗?
      
      
      威望:8
      头衔:总统
      等级:博士二年级(版主)
      文章:3942
      积分:27590
      门派:XML.ORG.CN
      注册:2004/7/21

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给卷积内核发送一个短消息 把卷积内核加入好友 查看卷积内核的个人资料 搜索卷积内核在『 网友互助 』的所有贴子 访问卷积内核的主页 引用回复这个贴子 回复这个贴子 查看卷积内核的博客4
    发贴心情 
    使用DISM对镜像进行编辑

    现在,让我们查看一下在已装载镜像可以执行哪些操作:

    C:\Program Files\Windows AIK\Tools\PETools>dism /image:C:\Servicing /?

    Deployment Image Servicing and Management tool

    Version: 6.1.7100.0

    Image Version: 6.1.7100.0

    The following commands may be used to service the image:

    WINDOWS EDITION SERVICING COMMANDS:

      /Set-ProductKey         - Populates the product key into the offline image.

      /Get-TargetEditions     - Displays a list of Windows editions that an image can be upgraded to.

      /Get-CurrentEdition     - Displays the editions of the specified image.

      /Set-Edition            - Upgrades the Windows image to a higher edition.

    UNATTEND SERVICING COMMANDS:

      /Apply-Unattend         - Applies an unattend file to an image.

    DRIVER SERVICING COMMANDS:

      /Remove-Driver          - Removes driver packages from an offline image.

      /Add-Driver             - Adds driver packages to an offline image.

      /Get-DriverInfo         - Displays information about a specific driver in an offline image or a running operating system.

      /Get-Drivers            - Displays information about all drivers in an offline image or a running operating system.

    INTERNATIONAL SERVICING COMMANDS:

      /Set-LayeredDriver      - Sets keyboard layered driver.

      /Set-UILang             - Sets the default system UI language that is used in the mounted offline image.

      /Set-UILangFallback     - Sets the fallback default language for the system UI in the mounted offline image.

      /Set-UserLocale         - Sets the user locale in the mounted offline image.

      /Set-SysLocale          - Sets the language for non-Unicode programs (also called system locale) and font settings in the mounted offline image.

      /Set-InputLocale        - Sets the input locales and keyboard layouts to use in the mounted offline image.

      /Set-TimeZone           - Sets the default time zone in the mounted offline image.

      /Set-AllIntl            - Sets all international settings in the mounted offline image.

      /Set-SKUIntlDefaults    - Sets all international settings to the default values for the specified SKU language in the mounted offline image.

      /Gen-LangIni            - Generates a new lang.ini file.

      /Set-SetupUILang        - Defines the default language that will be used by setup.

      /Get-Intl               - Displays information about the international settings and languages.

    APPLICATION SERVICING COMMANDS:

      /Check-AppPatch         - Displays information if the MSP patches are applicable to the mounted image.

      /Get-AppPatchInfo       - Displays information about installed MSP patches.

      /Get-AppPatches         - Displays information about all applied MSP patches for all installed applications.

      /Get-AppInfo            - Displays information about a specific installed MSI application.

      /Get-Apps               - Displays information about all installed MSI applications.

    PACKAGE SERVICING COMMANDS:

      /Add-Package            - Adds packages to the image.

      /Remove-Package         - Removes packages from the image.

      /Enable-Feature         - Enables a specific feature in the image.

      /Disable-Feature        - Disables a specific feature in the image.

      /Get-Packages           - Displays information about all packages in the image.

      /Get-PackageInfo        - Displays information about a specific package.

      /Get-Features           - Displays information about all features in a package.

      /Get-FeatureInfo        - Displays information about a specific feature.

      /Cleanup-Image          - Performs cleanup and recovery operations on the image.

    For more information about these servicing commands and their arguments,

    specify a command immediately before /?.

         Examples:

             DISM.exe /Image:C:\test\offline /Apply-Unattend /?

             DISM.exe /Image:C:\test\offline /Get-Features /?

             DISM.exe /Online /Get-Drivers /?

    ----------------------------------------------
    事业是国家的,荣誉是单位的,成绩是领导的,工资是老婆的,财产是孩子的,错误是自己的。

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2010/7/20 15:37:00
     
     卷积内核 帅哥哟,离线,有人找我吗?
      
      
      威望:8
      头衔:总统
      等级:博士二年级(版主)
      文章:3942
      积分:27590
      门派:XML.ORG.CN
      注册:2004/7/21

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给卷积内核发送一个短消息 把卷积内核加入好友 查看卷积内核的个人资料 搜索卷积内核在『 网友互助 』的所有贴子 访问卷积内核的主页 引用回复这个贴子 回复这个贴子 查看卷积内核的博客5
    发贴心情 
    使用DISM加载驱动

    这些参数可以在上面的DRIVER SERVICING COMMANDS 中找到。让我们使用/get-drivers 参数来显示安装在已装载镜像中的驱动:

    C:\Program Files\Windows AIK\Tools\PETools>dism /image:C:\Servicing /get-drivers

    Deployment Image Servicing and Management tool

    Version: 6.1.7100.0

    Image Version: 6.1.7100.0

    Obtaining list of 3rd party drivers from the driver store...

    Driver packages listing:

    Published Name : oem0.inf

    Original File Name : prnms001.inf

    Inbox : No

    Class Name : Printer

    Provider Name : Microsoft

    Date : 6/21/2006

    Version : 6.1.7100.0

    The operation completed successfully.


      现在可以用/add-driver 参数把LifeCam驱动添加到已装载镜像中:

    C:\Program Files\Windows AIK\Tools\PETools>dism /image:C:\Servicing /add-driver /driver:C:\Drivers\VX6000\vx6000.inf

    Deployment Image Servicing and Management tool

    Version: 6.1.7100.0

    Image Version: 6.1.7100.0

    Found 1 driver package(s) to install.

    Installing 1 of 1 - C:\Drivers\VX6000\vx6000.inf: The driver package was successfully installed.

    The operation completed successfully.

    Let's use /get-drivers again to verify that the LifeCam driver has been successfully added to the mounted image:

    C:\Program Files\Windows AIK\Tools\PETools>dism /image:C:\Servicing /get-drivers

    Deployment Image Servicing and Management tool

    Version: 6.1.7100.0

    Image Version: 6.1.7100.0

    Obtaining list of 3rd party drivers from the driver store...

    Driver packages listing:

    Published Name : oem0.inf

    Original File Name : prnms001.inf

    Inbox : No

    Class Name : Printer

    Provider Name : Microsoft

    Date : 6/21/2006

    Version : 6.1.7100.0

    Published Name : oem1.inf

    Original File Name : vx6000.inf

    Inbox : No

    Class Name : Image

    Provider Name : Microsoft

    Date : 7/18/2008

    Version : 5.5.3.74

    The operation completed successfully.

    ----------------------------------------------
    事业是国家的,荣誉是单位的,成绩是领导的,工资是老婆的,财产是孩子的,错误是自己的。

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2010/7/20 15:38:00
     
     卷积内核 帅哥哟,离线,有人找我吗?
      
      
      威望:8
      头衔:总统
      等级:博士二年级(版主)
      文章:3942
      积分:27590
      门派:XML.ORG.CN
      注册:2004/7/21

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给卷积内核发送一个短消息 把卷积内核加入好友 查看卷积内核的个人资料 搜索卷积内核在『 网友互助 』的所有贴子 访问卷积内核的主页 引用回复这个贴子 回复这个贴子 查看卷积内核的博客6
    发贴心情 
    使用DISM结束镜像编辑


    现在,可以通过卸载镜像来结束操作:

    C:\Program Files\Windows AIK\Tools\PETools>dism /unmount-wim /mountdir:C:\Servicing /commit

    Deployment Image Servicing and Management tool

    Version: 6.1.7100.0

    Image File : C:\Images\install.wim

    Image Index : 4

    Saving image

    [==========================100.0%==========================]

    Unmounting image

    [==========================100.0%==========================]

    The operation completed successfully.


      其他资源

      要获取更多有关DISM.exe的使用信息,在Deployment Tools Command Prompt中输入dism/?。另外,还可以点击“开始”菜单,从程序中找到Windows AIK用户指导(WAIK.chm),在其中的Deployment Tools Technical Reference部分也可以找到有关DISM.exe的详细信息。

    ----------------------------------------------
    事业是国家的,荣誉是单位的,成绩是领导的,工资是老婆的,财产是孩子的,错误是自己的。

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2010/7/20 15:39:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 网友互助 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/2 14:22:33

    本主题贴数6,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    3,812.500ms