China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-06 19:47
中国DOS联盟论坛 » 其它操作系统综合讨论区 » [Recommendation] Goodbye Ghost, Microsoft's Deployment Tool ImageX for Vista™ View 9,994 Replies 41
Original Poster Posted 2007-03-02 02:45 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
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 ]
第一高手 第二高手

Floor 2 Posted 2007-03-03 06:40 ·  中国 江苏 扬州 邗江区 电信
初级用户
Credits 32
Posts 41
Joined 2007-02-26 10:08
19-year member
UID 80212
Gender Male
Status Offline
ImageX for Vista

Still using XP... Is there one for XP and 2003
Floor 3 Posted 2007-03-03 11:17 ·  中国 上海 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline

But replacing DOS with Windows PE is an inevitable trend

Windows PE can replace DOS??? I haven't used it. Those who have used it, please share your experience.
Floor 4 Posted 2007-03-05 06:27 ·  中国 山东 聊城 电信
系统支持
★★★
Credits 1,011
Posts 435
Joined 2007-02-08 00:00
19-year member
UID 78999
Gender Male
Status Offline
I feel it's not okay.
How good is DOS?
How can WInPE compare?
Floor 5 Posted 2007-03-05 10:28 ·  中国 广东 肇庆 电信
中级用户
★★
Credits 349
Posts 102
Joined 2004-06-08 00:00
22-year member
UID 26329
Gender Male
Status Offline
I think it's still simpler to use GHOST!
Floor 6 Posted 2007-03-06 12:50 ·  中国 香港 环球全域电讯
初级用户
★★
Credits 121
Posts 61
Joined 2006-04-18 00:09
20-year member
UID 54007
Gender Male
From HK
Status Offline
"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...!?"
Floor 7 Posted 2007-03-07 07:48 ·  中国 山东 济南 移动
钻石会员
★★★★★
Credits 10,051
Posts 3,040
Joined 2002-11-11 00:00
23-year member
UID 223
Gender Male
Status Offline
I always feel that DOS is more convenient. I really thank Symantec for still maintaining the DOS version of Ghost.
简单就是美
Floor 8 Posted 2007-03-07 08:07 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
It still feels that it's not as easy to use as Ghost.
Floor 9 Posted 2007-03-08 03:55 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
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'>"
Floor 10 Posted 2007-03-08 18:55 ·  中国 河南 新乡 联通
等待验证用户
★★★
Credits 640
Posts 314
Joined 2006-08-13 17:20
19-year member
UID 60432
Gender Male
Status Offline
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.
Floor 11 Posted 2007-03-09 06:37 ·  中国 广东 佛山 南海区 电信
新手上路
Credits 4
Posts 2
Joined 2007-03-09 06:16
19-year member
UID 81162
Gender Male
Status Offline
Monopoly, even Ghost has been done, Microsoft deprives others of their living space.
Floor 12 Posted 2007-03-13 10:53 ·  中国 北京 海淀区 联通
初级用户
Credits 39
Posts 12
Joined 2005-07-24 17:22
21-year member
UID 41013
Status Offline
Dude, this thing is called ximage
Floor 13 Posted 2007-03-13 11:08 ·  中国 上海 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
Originally posted by AlexZhang at 2007-3-5 06:27:
I don't think it works.
How good is DOS?
How can WinPE compare?

Although I haven't used it, I completely agree with your view.
Floor 14 Posted 2007-03-19 11:06 ·  中国 广东 广州 天河区 电信
初级用户
Credits 69
Posts 38
Joined 2005-10-20 19:42
20-year member
UID 43806
Gender Male
Status Offline
I also think that using GHOST is still simpler
Floor 15 Posted 2007-03-22 22:59 ·  中国 河北 唐山 联通
新手上路
Credits 2
Posts 1
Joined 2007-03-22 10:47
19-year member
UID 82557
Gender Male
Status Offline
Still, Ghost is more comfortable, I'm used to it.
Forum Jump: