|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『楼 主』:
[推荐]再见了Ghost,微软封装工具ImageX for Vista™
使用 LLM 解释/回答一下
微软官方说明
http://www.microsoft.com/china/technet/prodtechnol/windowsvista/expert/ximage.mspx
微软2007-1-3发布的 Windows 自动安装工具包 (AIK)
发布页 下载页
已提取 ImageX 最新版6.0.6000.16386 for Vista™ (已包含WIM FS插件)
http://fastslz.googlepages.com/ImageX6000.7z
联盟会员曾发表过的2006-06-21,6.0.5728.16387原贴
http://www.cn-dos.net/forum/viewthread.php?tid=26097&fpage=1&highlight=Ximage
支持的操作系统:Windows Server 2003 SP1、Windows XP SP2、Windows Vista
微软封装工具ImageX的应用!
本文中我们将会介绍Ximage的几个基本应用:映像创建、映像压缩、映像文件拆分以及应用映像。
本文的所有操作都需要在Windows PE下进行。虽然这可能没有在DOS环境下方便,不过用Windows PE取代DOS已经是一个必然的趋势,同时,Windows PE环境也使Ximage的适用范围更广。
我们都知道,传统的基于磁盘扇区的映像工具一般只能在Windows操作系统之外运行,因此都使用了专用的恢复环境,例如软件开发商提供的特殊版本的 DOS。但这就存在一个问题,主要是关于存储子系统的。现在我们使用的存储子系统规格越来越多,除了传统的 IDE,常见的还有SCSI、SATA,以及各种级别的RAID等,如何让映像工具支持这些不常用的存储子系统成了一个最大的问题。
以使用DOS作为恢复环境的映像工具为例,如果该工具没有自带用于RAID系统的DOS驱动程序,那么就无法使用它对RAID系统创建和恢复映像。但 Ximage解决了这一问题,它的恢复环境是Windows PE,这可以看作是一个省略了图形界面的Windows内核,因此任何磁盘子系统,只要提供了Windows下的驱动程序,就可以用于Windows PE。
使用过程中大家可能会注意到,用Windows PE光盘引导计算机,进入Windows PE环境之前,屏幕上首先会显示“Press F6 to Install…”的字样,这和我们直接用光盘安装Windows操作系统时的选项类似。如果您使用了一些比较不常用的存储子系统,例如SCSI或者 RAID,就需要在这个界面上按下F6,然后提供所需的驱动程序,这样引导后Windows PE才可以识别出您的硬盘。
下文中,实验所用系统的设置如下:C盘安装操作系统,D盘是光驱,E盘用于保存创建的映像文件。不过当我们用Windows PE光盘引导计算机后情况有所变化,C盘依然是系统盘,但光驱成了X盘,Windows下的E盘成了Windows PE环境下的D盘。因此为了避免混淆,在Windows PE环境下的操作将会使用PE中的盘符名称,但在Windows环境下的操作将会使用Windows中的盘符。
创建映像
首先我们需要准备一台模板计算机,在这台计算机上安装打算批量部署的操作系统,并安装所有需要的驱动程序、应用软件、系统更新程序,同时我们还可以根据实际需要对系统和程序的各种
选项进行设置。设置完成之后运行sysprep.exe删除所有不必要的信息 ,并关闭计算机。
进行到这一步的时候,和使用传统的基于分区的影响工具部署都没有太大区别,不过接下来我们要使用微软自己的映像工具了。
假设我们希望使用默认设置创建一个C盘的映像,映像文件将以data.wim为名保存在D盘根目录下,并在创建完成后进行数据校验,那么我们可以使用这样一个命令:
ximage /capture c: d:\data.wim "Drive C " /verify
“/capture”参数的作用是创建映像文件,而该参数后面的“c:”则指定了要创建映像的目标分区。“d:\data.wim”这个参数指定了镜像文件的保存位置以及名称,“Drive C”参数定义了映像文件的描述,需要用引号引用。最后的“/verify”参数则会让Ximage创建完映像之后进行校验。当看到图1所示的界面时,表示我们的命令是正确的,程序正在创建C盘的映像。当屏幕显示“Successfully imaged c:\”的字样时表示映像已经创建完成了。
这时候我们就可以将创建出来的data.wim文件保存起来,并用于之后的部署了。这里还有一个有趣的功能需要提醒您:Ximage可以将创建出来的映像文件保存在预创建映像的分区上。例如本例中,我们就完全可以将data.wim保存在C盘,这其实是基于文件的映像工具和基于扇区的映像工具的最大不同。
压缩映像
当然,Ximage能做到的还有很多。有时我们可能会希望尽量减小生成的映像文件的体积,这时候就可以用到Ximage的压缩功能了。压缩参数有两个选项:Fast和Maximum,其中后者的压缩率更高一些,当然花费的时间也要长一些。还是上面的例子,如果需要以Maximum等级压缩创建出来的映像文件,可以使用这条命令:
ximage /compress maximum /capture c: d:\data2.wim “Drive C” /verify
遗憾的是该参数只能在创建映像文件的时候使用,对于已经创建好的映像文件,已经无法通过该参数进行压缩,或者更改压缩等级了。
拆分映像
如果您希望将创建出来的映像文件按照一定大小拆分,以便刻录到光盘或者保存到其他可以动存储介质上,那么可以使用Ximage的“/split”参数。例如,如果我们希望将之前创建的data.wim文件以640 MB为大小拆分,以便刻录到CD光盘上,那么可以使用这条命令:
ximage /split d:\data.wim d:\datasplited.swm 640
该操作将会创建一系列带有固定编号的.swm文件,例如我们要拆分的文件是data.wim,那么拆分后的文件就是data1.swm、 data2.swm等。该参数同样有些不足:首先,无法在创建映像文件的时候使用,只能在映像文件创建成功之后使用。另外,拆分的文件大小是以MB为单位指定的,如果我们需要以GB为单位拆分文件以便刻录DVD光盘上,显得不够灵活。
应用映像
我们已经创建好了系统映像文件,日后如果需要在多台计算机上部署,或者某台计算机的系统崩溃,就可以使用创建好的映像文件来恢复。恢复过程是非常简单的,依然需要进入到Windows PE环境下,然后使用“/apply”参数运行ximage.exe程序即可。
对于新计算机有一点需要注意,在使用Ximage安装操作系统映像之前,必须首先给硬盘分好区。您可以使用Windows PE自带的分区工具diskpart.exe进行。而如果您嫌麻烦,或者需要处理的计算机太多,也可以自己编写脚本,让Windows PE启动后自动进行分区操作。
假设我们要把之前创建的保存在D盘的data.wim文件重新恢复到C盘,那么可以首先格式化C盘,然后使用这条命令:
ximage /apply d:\data.wim 1 c: /verify
这里要注意映像名称后面的编号“1”,下文中我们将会介绍,Ximage可以把多个镜像文件附加到同一个映像中,那么在使用某个特定镜像部署系统,或者执行其他类似操作的时候,怎样从附加了多个镜像的映像文件中指定特定镜像呢?这里就需要使用编号了,如果希望对第几个镜像进行操作,在映像文件名称后添加该镜像的编号即可。
高级应用
除了上面介绍的功能,ximage还有很多功能可以适合不同情况。同样,下文将会通过几个具体的实例向您介绍。
文件附加
有时我们可能会遇到这样的情况:当我们安装好操作系统之后,需要创建一个映像文件;而安装完补丁程序以及驱动程序之后,需要创建另外一个映像;等安装完所有其他需要的应用程序,并进行过必要的设置之后,还需要创建第三个映像文件。这样的要求有一个特点,那就是三个映像文件中大部分数据都是相同的,而每次都是只有部分文件被增删或者更改。那么按照一般的做法,直接创建三个各自独立的映像文件,无疑浪费了大量的存储空间,而且映像文件太多也不利于日后的管理。
为了解决这个问题,Ximage中包含了一个叫做附加的功能。简单来说,该功能可以在一个映像文件中保存多个不同状态下的操作系统镜像。例如之前设想的情况,将操作系统在三个时候的不同状态全部附加到同一个映像文件中,这样,因为操作系统中有大量三个状态下没有发生任何更改的文件,因此这些文件实际上在映像文件中只需要保存一个实例,这就可以在压缩的基础上更进一步减小映像文件的体积。
注意,这里提到了两个名词:“映像”和“镜像”。为了方便叙述,下文对这两个名词的定义如下:对操作系统所在分区进行“复制”创建的文件称之为“镜像”,而多个“镜像”附加在一起即形成一个“映像”。
在上文的操作中我们已经对整个系统盘创建了一个完整映像data.wim,假设当时我们只是安装了操作系统,还没有装驱动和应用程序,那么现在我们可以启动到正常Windwos状态下,按照需要安装所有的驱动和程序,然后重启动计算机到Windows PE环境(别忘了运行sysprep.exe)。要创建新的镜像,并附加到现有的映像文件中,可以使用下列命令:
ximage /append c: d:\data.wim “Drive C 2” /verify。
“/append”的作用是将目标分区附加到现有文件,需要注意,如果已经使用了“/append”参数,就不需要同时使用“/capture”了。而后面的“d:\data.wim”则指定了要被附加的文件所在位置和名称。
注意,如果被附加的源映像文件被压缩过,那么附加上去的镜像文件就必须进行同样等级的压缩。
配置文件
Ximage的某些选项可以由配置文件指定,这样我们就可以预先编写好配置文件,然后一次执行,实现比较复杂的操作。要指定配置文件,需要以“/config”参数启动Ximage。配置文件中主要有三个字段,各自的含义如下。
定义了使用“/capture”参数后被排除的文件和文件夹名称
定义了不被压缩的文件或文件夹名称,或者文件类型。这里可以使用通配符
指定文件以64K为范围排列,这些文件将不会被压缩,而压缩后的文件将会以32K为范围排列。
我们只需要在文本编辑器,例如Windows记事本中按照上述规定的字段编写内容,然后将文件保存为.ini格式,就可以在使用ximage.exe的时候通过“/config”参数调用了。
打开Windows记事本或者其他任何文本编辑器,分别输入、和三个字段,然后按照需要为这三个字段设定内容。
例如,如果我们希望在创建映像文件的时候跳过分页文件和休眠文件,那么就可以在字段下添加这两个文件的名称: “Hiberfil.sys”和“Pagefile.sys”。注意,每个文件要占用一行空间。如果我们希望在压缩文件的时候取消对所有扩展名为.zip 的文件的压缩(毕竟它们已经被压缩过了,再次压缩只能延长所需时间,体积的变化不会太明显),那么可以在 字段下添加“*.zip”这一行内容。
注意:通常情况下,如果要使用配置文件,那么就必须在运行ximage命令的时候使用/config参数,并指定配置文件的位置。但如果我们预先将配置文件以wimscript.ini为名保存在ximage.exe文件所在的文件夹下,那么以后运行的时候只要使用了“/capture”参数,该配置文件就会被自动加载,而不管我们有没有配合“/config”参数一起使用。
映像文件的维护
我们已经了解了如何创建和应用映像文件,那么日常维护方面,这种新的文件格式又能带给我们什么?需要注意,之前介绍的所有操作都是使用Ximage在Windows PE的命令行环境下运行,而接下来要介绍的一些功能在正常的Windows模式下就可以操作。
查看映像文件信息
我们首先继续讨论一下前文中存在的一个问题,对于附加了多个镜像的映像文件,可以通过添加编号的方式指定对哪个镜像进行操作。但是一旦时间长了,我们如何知道某个映像文件中有几个镜像,分别是什么内容?这就要用到Ximage的另一个参数“/info”了。
还是以上文创建的附加了多个镜像的映像文件data.wim为例,在Windows PE环境下,运行这样的命令:ximage /info d:\data.wim,我们可以看到,程序会自动显示一个以XML格式保存的文件,文件的内容就是该映像文件中所有附加的镜像文件的信息(图3)。这里面大家可以留意看“”这一字段的内容,这其实就是我们在使用 “/capture”参数创建映像时输入的描述。因此在使用的时候要注意输入详细的描述信息,方便日后的使用。
查看映像文件内容
随着使用时间的延长,管理员们可能需要管理越来越多各种用途的映像文件。如何快速从多个映像文件中找到自己的目标就显得非常重要。通过使用Ximage的 “/dir”参数,我们就可以直接把某个映像文件,甚至具体到其中附加的某个镜像的内容显示出来。该参数的使用方法是这样的:ximage /dir d:\data.wim 1。
首先让我们试试看使用“/dir”参数列出映像文件中具体某个镜像的内容。回到Windows正常状态下(注意,这一步操作不能在Windows PE环境下进行,必须回到Windows下),然后运行下列命令:
ximage /dir d:\data.wim 1
这将显示data.wim这个映像文件中包含的镜像内容(如果映像文件中包含了多个镜像,也可以通过编号指定具体镜像)。这里显示的内容非常多,查看起来很不方便,那么我们就可以使用这样的命令:
ximage /dir d:\data.wim 1 >d:\list.txt
该命令可以将显示的内容全部输出到D盘一个名为list.txt的文本文件中,使用文本编辑器查看和搜索具体文件就相当简单了。
这里有个问题需要注意,就算您的映像文件中只包含了一个镜像,在使用/dir参数的时候依然需要在文件名后面指定镜像编号,否则将无法列出其中的内容。暂时不清楚这是设计特性还是软件的Bug。
将映像文件内容映射为文件夹
除了使用“/dir”参数列出映像文件的概括内容,我们还可以使用“/mount”参数和“/unmount”参数将映像文件中具体的镜像映射为本地硬盘上的文件夹,并编辑其中的内容。“/mount”参数有两个,分别是“/mount”和“/mountrw”,其中前者可以将镜像映射为只读文件夹,而后者可以将镜像映射为可读写文件夹。
要注意,这两个命令都只能在Windows XP SP2、Windows Server 2003 SP1以及Windows Vista中使用。同时在映射之前,还要安装WIM FS插件,该插件在WAKI工具包中提供。
安装好插件之后,在命令提示行窗口内运行下列命令:
ximage /mountrw e:\c e:\data.wim 1
“e:\c”的含义是将镜像映射到E盘下一个名为“c”的文件夹中。如果该文件夹内当前有文件,那么在被映射的镜像卸载之前,原先的内容将无法访问。映射了镜像之后,我们就可以使用Windows资源管理器打开映射出来的文件夹,查看其中的内容,添加或者删除文件,或者像在操作本地硬盘那样进行其他操作。
因为我们之前使用的参数是“/mountrw”,这样映射出来的文件是可写的,因此当用完之后,为了使对文件的更改能够生效,我们需要使用 “/unmount”参数配合“/commit”选项,合并对映像文件的修改,并将其卸载。可以用这样的命令:ximage /unmount /commit e:\c。
镜像的提取和删除
有时候您可能会遇到这样的情况:一个映像文件中附加了很多不同环境的镜像文件,可其中一个镜像文件已经没用了。为了减少存储空间的占用,您可能希望删除不用的镜像文件。同时,您可能还会有这样的需求:想要将附加到一个映像文件中的独立镜像提取出来,做其他用途。这些任务依然可以通过Ximage的参数实现(本段内容需要在Windows PE环境下操作)。
要删除映像文件中附加的镜像,我们可以使用“/delete”参数,例如:ximage /delete d:\data.wim 1。如果希望将映像文件中的某个镜像提取出来,可以使用“/export”参数,例如:ximage /export d:\new.wim d:\data.wim 1。
注意,在提取镜像的时候一定要保证目标映像文件的所在分区具有足够的可用空间。如果可用空间不足,程序不会报错,依然会生成新的映像文件,但是文件本身是不完整的。
ximage.exe的不足
虽然优势很多,不过目前ximage.exe还有很多不足,主要表现在:
Ximage只能用于对完整的操作系统以及应用程序创建和应用映像。有些第三方的映像工具可以在操作系统和应用程序发生改变后对其创建“差异映像”,这个ximage.exe是做不到的。
Ximage只能创建和使用.wim(Windows Imaging)格式的映像文件,不支持使用其他第三方工具创建的映像。
对于同一个映像文件只能使用一种压缩等级,随后附加的镜像文件也必须使用和初始映像文件一样的压缩等级。
映像文件的映射只能在Windows XP SP2、Windows Server 2003 SP1或者Windows Vista下进行。但是Ximage可以对没有安装Service Pack的Windows XP和Windows Server 2003,以及任何版本的Windows 2000创建映像文件。
只有保存在NTFS文件系统下的映像文件才可以被映射为具有读/写权限的文件夹,而保存在FAT、FAT32、ISO或UDF文件系统下的映像文件只能被映射为只读文件夹。这主要是为了避免FAT/FAT32文件系统最大2GB文件的体积限制有可能导致的数据丢失。
该工具不具有磁盘操作能力,因为需要使用微软的其他工具,例如Diskpart以及Format准备用于卷映像的磁盘分区。
Last edited by fastslz on 2007-3-1 at 05:43 PM ]
Microsoft Official Instructions
http://www.microsoft.com/china/technet/prodtechnol/windowsvista/expert/ximage.mspx
Windows Automated Installation Kit (AIK) released by Microsoft on 2007-1-3
Release Page Download Page
The latest version 6.0.6000.16386 for Vista™ of ImageX has been extracted (includes WIM FS plug-in)
http://fastslz.googlepages.com/ImageX6000.7z
The original post of the union members published on 2006-06-21, 6.0.5728.16387
http://www.cn-dos.net/forum/viewthread.php?tid=26097&fpage=1&highlight=Ximage
Supported operating systems: Windows Server 2003 SP1, Windows XP SP2, Windows Vista
Application of Microsoft's Imaging Tool ImageX!
In this article, we will introduce several basic applications of Ximage: image creation, image compression, image file splitting, and applying images.
All operations in this article need to be performed under Windows PE. Although this may not be as convenient as in the DOS environment, replacing DOS with Windows PE is an inevitable trend, and the Windows PE environment also makes Ximage applicable to a wider range.
We all know that traditional sector-based imaging tools generally can only run outside the Windows operating system, so they use a dedicated recovery environment, such as a special version of DOS provided by software developers. But there is a problem here, mainly regarding the storage subsystem. The storage subsystems we use are becoming more and more diverse. In addition to traditional IDE, there are common ones such as SCSI, SATA, and various levels of RAID. How to make the imaging tool support these less common storage subsystems has become the biggest problem.
Take an imaging tool that uses DOS as the recovery environment as an example. If the tool does not have a built-in DOS driver for the RAID system, it cannot be used to create and restore images for the RAID system. But Ximage solves this problem. Its recovery environment is Windows PE, which can be regarded as a Windows kernel without a graphical interface. Therefore, any disk subsystem can be used for Windows PE as long as a driver for Windows is provided.
During use, everyone may notice that when booting the computer with a Windows PE CD and entering the Windows PE environment, the screen first displays the words "Press F6 to Install...", which is similar to the option when directly installing the Windows operating system with a CD. If you use some less common storage subsystems, such as SCSI or RAID, you need to press F6 on this interface and provide the required driver, so that the hard disk can be recognized by Windows PE after booting.
In the following text, the settings of the experimental system are as follows: the C drive installs the operating system, the D drive is the optical drive, and the E drive is used to save the created image file. But when we boot the computer with a Windows PE CD, the situation changes. The C drive is still the system drive, but the optical drive becomes the X drive, and the E drive under Windows becomes the D drive in the Windows PE environment. Therefore, to avoid confusion, the operations in the Windows PE environment will use the drive letters in PE, but the operations in the Windows environment will use the drive letters in Windows.
Creating an Image
First, we need to prepare a template computer. Install the operating system that we plan to deploy in batches on this computer, and install all required drivers, application software, and system updates. At the same time, we can also set various options of the system and programs according to actual needs. After setting is complete, run sysprep.exe to delete unnecessary information and shut down the computer.
At this step, there is not much difference from using traditional partition-based imaging tools for deployment. However, next we will use Microsoft's own imaging tool.
Suppose we want to create an image of the C drive using default settings. The image file will be saved in the root directory of the D drive with the name data.wim, and data verification will be performed after creation. Then we can use such a command:
ximage /capture c: d:\data.wim "Drive C " /verify
The role of the "/capture" parameter is to create an image file, and the "c:" following this parameter specifies the target partition for which the image is to be created. The parameter "d:\data.wim" specifies the save location and name of the image file, the parameter "Drive C" defines the description of the image file and needs to be enclosed in quotes. The final "/verify" parameter will make Ximage verify after creating the image. When seeing the interface shown in Figure 1, it means our command is correct and the program is creating the image of the C drive. When the screen displays the words "Successfully imaged c:\", it means the image has been created.
At this time, we can save the created data.wim file and use it for subsequent deployment. There is also an interesting function to remind you: Ximage can save the created image file on the partition where the image is pre-created. For example, in this example, we can completely save data.wim on the C drive. This is actually the biggest difference between file-based imaging tools and sector-based imaging tools.
Compressing the Image
Of course, Ximage can do more. Sometimes we may want to minimize the size of the generated image file. At this time, we can use the compression function of Ximage. There are two options for the compression parameter: Fast and Maximum. The latter has a higher compression ratio, but it also takes more time. Still using the above example, if we need to create the image file with Maximum level compression, we can use this command:
ximage /compress maximum /capture c: d:\data2.wim “Drive C” /verify
Unfortunately, this parameter can only be used when creating the image file. For an already created image file, it is no longer possible to compress or change the compression level through this parameter.
Splitting the Image
If you want to split the created image file into certain sizes for burning to a CD or saving to other removable storage media, you can use the "/split" parameter of Ximage. For example, if we want to split the previously created data.wim file into 640 MB sizes for burning to a CD, we can use this command:
ximage /split d:\data.wim d:\datasplited.swm 640
This operation will create a series of.swm files with fixed numbers. For example, if the file to be split is data.wim, the split files will be data1.swm, data2.swm, etc. This parameter also has some shortcomings: first, it cannot be used when creating the image file, only after the image file is successfully created. In addition, the size of the split file is specified in MB. If we need to split the file in GB to burn to a DVD, it is not flexible enough.
Applying the Image
We have created the system image file. In the future, if we need to deploy on multiple computers or the system of a certain computer crashes, we can use the created image file to restore. The recovery process is very simple, and we still need to enter the Windows PE environment and then run the ximage.exe program with the "/apply" parameter.
For a new computer, there is one thing to note. Before using Ximage to install the operating system image, the hard disk must be partitioned first. You can use the partition tool diskpart.exe built into Windows PE. And if you find it troublesome or need to handle too many computers, you can also write your own script to automatically perform the partitioning operation after Windows PE starts.
Suppose we want to restore the previously created data.wim file saved on the D drive back to the C drive. Then we can first format the C drive and then use this command:
ximage /apply d:\data.wim 1 c: /verify
Note the number "1" after the image name here. In the following text, we will introduce that Ximage can attach multiple images to the same image. Then, when using a specific image to deploy the system or perform other similar operations, how to specify a specific image from the image file to which multiple images are attached? Here, the number is needed. If you want to operate on the nth image, add the number of the image after the image file name.
Advanced Applications
In addition to the functions introduced above, ximage has many functions suitable for different situations. Similarly, the following will introduce through several specific examples.
File Attachment
Sometimes we may encounter such a situation: after we install the operating system, we need to create an image file; after installing patches and drivers, we need to create another image; after installing all other required application programs and performing necessary settings, we also need to create a third image file. This requirement has a characteristic that most of the data in the three image files are the same, and each time only some files are added, deleted, or changed. Then, according to the general practice, directly creating three independent image files will undoubtedly waste a lot of storage space, and too many image files are not conducive to future management.
To solve this problem, Ximage includes a function called attachment. Simply put, this function can save multiple operating system images in different states in one image file. For example, in the situation conceived above, all three different states of the operating system at three times are attached to the same image file. In this way, because there are a large number of files that have not changed in the three states in the operating system, these files actually only need to be saved as one instance in the image file, which can further reduce the size of the image file on the basis of compression.
Note that two terms are mentioned here: "image" and "mirror". For the convenience of narration, the definitions of these two terms are as follows in the following text: the file created by "copying" the partition where the operating system is located is called a "mirror", and multiple "mirrors" attached together form an "image".
In the above operation, we have created a complete image data.wim for the entire system drive. Suppose we only installed the operating system at that time and had not installed drivers and application programs. Then now we can start to the normal Windows state, install all required drivers and programs according to needs, and then restart the computer to the Windows PE environment (don't forget to run sysprep.exe). To create a new mirror and attach it to the existing image file, we can use the following command:
ximage /append c: d:\data.wim “Drive C 2” /verify.
The role of "/append" is to attach the target partition to the existing file. Note that if the "/append" parameter is used, there is no need to use "/capture" at the same time. And the following "d:\data.wim" specifies the location and name of the file to be attached.
Note that if the source image file to be attached is compressed, the attached mirror file must be compressed at the same level.
Configuration File
Some options of Ximage can be specified by a configuration file, so that we can pre-write the configuration file and then execute it once to realize more complex operations. To specify the configuration file, Ximage needs to be started with the "/config" parameter. There are mainly three fields in the configuration file, and their meanings are as follows.
Defines the names of files and folders excluded after using the "/capture" parameter
Defines the names of files or folders, or file types that are not compressed. Wildcards can be used here
Specifies that files are arranged in 64K ranges, and these files will not be compressed, while compressed files will be arranged in 32K ranges.
We only need to write the content according to the above specified fields in a text editor, such as Windows Notepad, and then save the file in.ini format, and then we can call it through the "/config" parameter when using ximage.exe.
Open Windows Notepad or any other text editor, enter the three fields , , and respectively, and then set the content for these three fields as needed.
For example, if we want to skip the page file and hibernation file when creating the image file, we can add the names of these two files under the field: "Hiberfil.sys" and "Pagefile.sys". Note that each file should occupy one line of space. If we want to cancel the compression of all files with the.zip extension when compressing files (after all, they have been compressed, and compressing again can only extend the required time, and the change in volume will not be too obvious), then we can add the line "*.zip" under the field.
Note: Usually, if you want to use the configuration file, you must use the /config parameter when running the ximage command and specify the location of the configuration file. But if we pre-save the configuration file as wimscript.ini in the folder where ximage.exe is located, then when we run it later, as long as we use the "/capture" parameter, this configuration file will be automatically loaded, regardless of whether we use the "/config" parameter together.
Maintenance of Image Files
We have learned how to create and apply image files. Then, in daily maintenance, what can this new file format bring us? Note that all the operations introduced above are run under the command line environment of Windows PE using Ximage, and some functions introduced below can be operated in the normal Windows mode.
Viewing Image File Information
Let's continue to discuss a problem that existed in the previous text. For an image file to which multiple mirrors are attached, the number can be added to specify which mirror to operate on. But once it takes a long time, how do we know how many mirrors are in a certain image file and what their contents are? This is where the other parameter "/info" of Ximage comes in.
Still taking the image file data.wim to which multiple mirrors are attached created above as an example, in the Windows PE environment, run such a command: ximage /info d:\data.wim, and we can see that the program will automatically display an XML-formatted file, and the content of the file is the information of all attached mirror files in this image file (Figure 3). Here, you can pay attention to the content of the "" field, which is actually the description entered when using the "/capture" parameter to create the image. Therefore, when using it, pay attention to entering detailed description information for future use.
Viewing Image File Content
As the use time increases, administrators may need to manage more and more image files for various purposes. How to quickly find the target from multiple image files is very important. By using the "/dir" parameter of Ximage, we can directly display the content of a certain image file, even a specific mirror attached to it. The usage method of this parameter is as follows: ximage /dir d:\data.wim 1.
First, let's try to use the "/dir" parameter to list the content of a specific mirror in the image file. Return to the normal Windows state (note that this step cannot be performed in the Windows PE environment, and must return to Windows), and then run the following command:
ximage /dir d:\data.wim 1
This will display the content of the mirror contained in the data.wim image file (if the image file contains multiple mirrors, you can also specify the specific mirror through the number). The content displayed here is very much, and it is very inconvenient to view. Then we can use such a command:
ximage /dir d:\data.wim 1 >d:\list.txt
This command can output all the displayed content to a text file named list.txt on the D drive. It is quite simple to use a text editor to view and search for specific files.
There is a problem that needs to be noted here. Even if your image file contains only one mirror, when using the /dir parameter, you still need to specify the mirror number after the file name, otherwise the content cannot be listed. It is temporarily unclear whether this is a design feature or a software bug.
Mapping Image File Content to a Folder
In addition to using the "/dir" parameter to list the general content of the image file, we can also use the "/mount" parameter and the "/unmount" parameter to map a specific mirror in the image file to a folder on the local hard disk and edit its content. There are two "/mount" parameters, namely "/mount" and "/mountrw", where the former can map the mirror to a read-only folder, and the latter can map the mirror to a read-write folder.
Note that these two commands can only be used in Windows XP SP2, Windows Server 2003 SP1, and Windows Vista. At the same time, before mapping, the WIM FS plug-in must be installed, and this plug-in is provided in the WAKI tool kit.
After installing the plug-in, run the following command in the command prompt window:
ximage /mountrw e:\c e:\data.wim 1
The meaning of "e:\c" is to map the mirror to a folder named "c" under the E drive. If there are files in this folder currently, the original content will not be accessible until the mapped mirror is unmounted. After mapping the mirror, we can use Windows Explorer to open the mapped folder, view its content, add or delete files, or perform other operations like operating on the local hard disk.
Because the parameter we used earlier is "/mountrw", the mapped file is writable. Therefore, after use, in order to make the changes to the file take effect, we need to use the "/unmount" parameter in combination with the "/commit" option to merge the changes to the image file and unmount it. We can use such a command: ximage /unmount /commit e:\c.
Extracting and Deleting Mirrors
Sometimes you may encounter such a situation: a large number of mirror files in different environments are attached to an image file, but one of the mirror files is no longer useful. In order to reduce the occupied storage space, you may want to delete the unused mirror file. At the same time, you may also have such a need: you want to extract an independent mirror attached to an image file for other purposes. These tasks can still be realized through the parameters of Ximage (this section needs to be operated in the Windows PE environment).
To delete the attached mirror in the image file, we can use the "/delete" parameter, for example: ximage /delete d:\data.wim 1. If we want to extract a certain mirror in the image file, we can use the "/export" parameter, for example: ximage /export d:\new.wim d:\data.wim 1.
Note that when extracting the mirror, be sure to ensure that there is enough free space on the partition where the target image file is located. If the free space is insufficient, the program will not report an error and will still generate a new image file, but the file itself is incomplete.
Shortcomings of ximage.exe
Although there are many advantages, currently ximage.exe has many shortcomings, mainly as follows:
Ximage can only be used to create and apply images for the complete operating system and application programs. Some third-party imaging tools can create "differential images" after the operating system and application programs change, which ximage.exe cannot do.
Ximage can only create and use.wim (Windows Imaging) format image files and does not support using image files created by other third-party tools.
Only one compression level can be used for the same image file, and the attached mirror files must also use the same compression level as the initial image file.
The mapping of image files can only be performed under Windows XP SP2, Windows Server 2003 SP1, or Windows Vista. But Ximage can create image files for Windows XP and Windows Server 2003 without installing Service Pack, as well as any version of Windows 2000.
Only image files saved on the NTFS file system can be mapped to folders with read/write permissions, while image files saved on FAT, FAT32, ISO, or UDF file systems can only be mapped to read-only folders. This is mainly to avoid data loss possibly caused by the maximum 2GB file volume limit of the FAT/FAT32 file system.
This tool does not have disk operation capabilities because other Microsoft tools, such as Diskpart and Format, need to be used to prepare the disk partition for the volume image.
Last edited by fastslz on 2007-3-1 at 05:43 PM ]
|

第一高手 第二高手
我的小站
 |
|
2007-3-2 02:45 |
|
|
MSDN
初级用户
 
积分 32
发帖 41
注册 2007-2-26
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
ImageX for Vista
还在用XP...有没有for XP and 2003
ImageX for Vista
Still using XP... Is there one for XP and 2003
|
|
2007-3-3 06:40 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2007-3-3 11:17 |
|
|
AlexZhang
系统支持
            
积分 995
发帖 427
注册 2007-2-8
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
我感觉不行
DOS多好?
WInPE怎么能比?
I feel it's not okay.
How good is DOS?
How can WInPE compare?
|
|
2007-3-5 06:27 |
|
|
qinccckencn
中级用户
  
积分 349
发帖 102
注册 2004-6-8
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
我觉得还是用GHOST来得简单啊!!
I think it's still simpler to use GHOST!
|
|
2007-3-5 10:28 |
|
|
tsenix
初级用户
 
积分 121
发帖 61
注册 2006-4-18 来自 HK
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
"该工具不具有磁盘操作能力,因为需要使用微软的其他工具,例如Diskpart以及Format准备用于卷映像的磁盘分区。"
看来只是一个介面...!?
"This tool does not have disk operation capabilities because other Microsoft tools are needed, such as Diskpart and Format to prepare disk partitions for volume images.
It seems just an interface...!?"
|
|
2007-3-6 12:50 |
|
|
Michael
钻石会员
       
积分 10046
发帖 3039
注册 2002-11-11
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
总觉得还是dos方便些,真的很感谢Symantec,仍然维护着ghost的DOS版。
I always feel that DOS is more convenient. I really thank Symantec for still maintaining the DOS version of Ghost.
|

简单就是美 |
|
2007-3-7 07:48 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
感觉还是没有ghost好使
It still feels that it's not as easy to use as Ghost.
|
|
2007-3-7 08:07 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
WinPE是现在的主流
WinPE is the mainstream now
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2007-3-8 03:55 |
|
|
tangtai
高级用户
   
积分 640
发帖 314
注册 2006-8-13
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
我更喜欢DOS+微型Linux的组合,更开放,更自由,而且有数不胜数的工具可以使用!!
个人感觉Ghost更方便。
I prefer the combination of DOS + mini Linux, which is more open and free, and there are countless tools available!! Personally, I feel Ghost is more convenient.
|
|
2007-3-8 18:55 |
|
|
dext
新手上路

积分 4
发帖 2
注册 2007-3-9
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
垄断啊,连ghost也做了,微软剥夺别人的生存空间。
Monopoly, even Ghost has been done, Microsoft deprives others of their living space.
|
|
2007-3-9 06:37 |
|
|
zrh4019
初级用户
 
积分 39
发帖 12
注册 2005-7-24
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
老兄,这东西叫ximage
Dude, this thing is called ximage
|
|
2007-3-13 10:53 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2007-3-13 11:08 |
|
|
linyong11
初级用户
 
积分 69
发帖 38
注册 2005-10-20
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
我也觉得还是用GHOST来得简单
I also think that using GHOST is still simpler
|
|
2007-3-19 11:06 |
|
|
flyfish124
新手上路

积分 2
发帖 1
注册 2007-3-22
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
还是ghost舒服一些,习惯了.
Still, Ghost is more comfortable, I'm used to it.
|
|
2007-3-22 22:59 |
|
|