8
Windows ADK DISM commands to capture and apply images With the introduction of the new Accessment and Deployment Kit for Windows 8 which is the new iteration of what we have known as the WAIK for automating installs, Microsoft has deprecated the imagex command to manage, capture, and apply images in favor of using the dism command for all aspects of image management. We have put together a cheat sheet if you will below of the most common commands that admins will use in order to capture, apply, and manage images now with the new Windows 8 ADK using the dism command. Admins will note the more “powershell-ish” command syntax with the dism commands. With that being said one of the exciting features of the new ADK environment is the ability to incorporate powershell which opens up a whole new array of commands at the admin’s disposal. Along with the new features, with ever interation of the WAIK/ADK environment, the driver support gets better and better minimizing the need for incorporated driver packs to recognize network adapters, etc. Capture Images Dism /Capture-Image /ImageFile:install.wim /CaptureDir:D: /Name:Drive-D 1. Dism /Capture-Image /ImageFile:c:windows.wim /CaptureDir:C: /Name:”Windows” Dism /Capture-Image /ImageFile:s:system.wim /CaptureDir:S: /Name:”System”

Windows ADK DISM commands to capture and apply images.doc

Embed Size (px)

DESCRIPTION

Use to modify

Citation preview

Page 1: Windows ADK DISM commands to capture and apply images.doc

Windows ADK DISM commands to capture and apply imagesWith the introduction of the new Accessment and Deployment Kit for Windows 8 which is the new iteration of what we have known as the WAIK for automating installs, Microsoft has deprecated the imagex command to manage, capture, and apply images in favor of using the dism command for all aspects of image management.  We have put together a cheat sheet if you will below of the most common commands that admins will use in order to capture, apply, and manage images now with the new Windows 8 ADK using the dism command.  Admins will note the more “powershell-ish” command syntax with the dism commands.

 

With that being said one of the exciting features of the new ADK environment is the ability to incorporate powershell which opens up a whole new array of commands at the admin’s disposal.  Along with the new features, with ever interation of the WAIK/ADK environment, the driver support gets better and better minimizing the need for incorporated driver packs to recognize network adapters, etc.

 

Capture ImagesDism /Capture-Image /ImageFile:install.wim /CaptureDir:D: /Name:Drive-D

1. Dism /Capture-Image /ImageFile:c:windows.wim /CaptureDir:C: /Name:”Windows”

Dism /Capture-Image /ImageFile:s:system.wim /CaptureDir:S: /Name:”System”

Apply Images

Dism /apply-image /imagefile:install.wim /index:1 /ApplyDir:D:

Dism /apply-image /imagefile:Z:Imageswindows.wim /index:1 /ApplyDir:W:

Boot Files:    C:\Windows\System32\bcdboot W:\Windows /l en-US

Mount a .WIM image

dism /mount-wim /wimfile:”c:\path to your WADKsourcesboot.wim” /index:1 /mountdir:c:\mount

Page 2: Windows ADK DISM commands to capture and apply images.doc

Unmount a .WIM imageDISM /Unmount-Wim /Mountdir:C:\DirMount /CommitGet mounted Wim Images

dism /get-MountedWiminfoCapture imagesDism /Capture-Image /ImageFile:c:\windows.wim /CaptureDir:C:\ /Name:”Windows”Dism /Capture-Image /ImageFile:s:\windows.wim /CaptureDir:S:\ /Name:”System”Adding drivers:DISM.exe /image:”c:imagesImage1″ /Add-Driver /ForceUnsigned /DriverName:”C:\Drivers\1.inf” /DriverName:”C:\Drivers\2.inf” /DriverName:”C:\Drivers3.inf”

How to Extract and Modify WIM Files(IMAGEX)

Sometimes when some of the dll files gets deleted somehow or certain Windows features crashes due to corrupt file then we had use system Restore or have to perform clean installation to get those files back. But while we use System Restore or we perform clean installation some or all our installed gets deleted. install.wim file in your windows 7 or windows vista DVD contains a windows image. IF we could Extract it then we could use those files it to replace the corrupted file in our Windows.Or you can also modify the .wim file to add or delete a program or file.

This tutorial is all about how to mount or modify install.wim or any .wim file.Things you need: 1)ImageX.exe from the Windows Automated Installation Kit (WAIK)2)install.wim file from you windows installation DVD.3)More than 5GB of hdd space.

Copy the install.wim file to you local hard disk(let say i copied it to f:\).let say you have kept imagex.exe in c:\ drive. And you are going to mount the .wim file in d:\mount.

NoteYou cannot mount .wim file directly to any driveTo mount .wim file in d:\mount at first we have to make a folder in d:\ named mount.

There are two process of mounting:1)with read only permission(you can`t modify .wim file).2)with read write permission(you can modify .wim file).1) Mounting With read only permission:Open command and go to c:\then type: imagex /mount f:\install.wim 2 d:\mountAnd install.wim will be mounted to d:\mount.

Page 3: Windows ADK DISM commands to capture and apply images.doc

2) Mounting with read\write permission:Open command and go to c:\then type

imagex /mountrw f:\install.wim 2 d:\mount

Notewhere d:\mount is the location of the mount directory, f:\install.wim is the name and the location of the .wim file to mount, and 2 is the reference number of the specific volume in the .wim file.Modifying an ImageAfter you mount an image, the directory structure becomes available from a file-management tool, such as Windows Explorer. From the file-management tool, you can review your file and folder structure and add, edit, or delete files and folders.

To view files and foldersOn yourcomputer, start Windows Explorer, and then open the mounted directory. For example,

d:\mountReview the file and folder structure, including content.To Add Files or Folders

If you must add an application or a device, verify that you included all of the required files. Although you can add application files and folders, you cannot install applications.To edit files or folders

Page 4: Windows ADK DISM commands to capture and apply images.doc

On your computer, start Windows Explorer, and then open the mounted directory. For example,

d:\mountEdit the files and the folders. Move the files and the folders within your image, or open the files and view their contents.

To delete files or foldersOn your computer, start Windows Explorer, and then open the mounted directory. For example,

C:\mountTo delete a file or a folder, press SHIFT+DELETE.

   NoteYou cannot delete an entire .wim file. However, you can delete all of the files contained within the image. The DELETE key alone will not delete any files or folders you have to use SHIFT+DELETE.

To Unmount an ImageOn your computer, at a command prompt, open the ImageX directory(as on my computer i have kept it in c:\).

Then type: imagex /unmount /commit d:\mount

Notewhere d:\mount is the location of the mount directory. If you do not specify the parameters to unmount, this option lists all of the mounted images but does not perform the unmount action.

If you use the /unmount option without the /commit option, your changes will be discarded. To save your changes, you must mount the image by using the /mountrw option and the /commit option when unmounting the image.

Feel free to comment. And if i have done any mistake in the tutorial feel free to speak about it. Thanks for reading.

Quick questions:

1. What indexes are present in your WIM file?2. Did you slipstream drivers on all indexes?

You have to force unsigned. Here is the process I used:

Windows 7 - x64 - Enterprise

# Setup Encironment for install

Page 5: Windows ADK DISM commands to capture and apply images.doc

mkdir C:\Injectcd "C:\Inject"mkdir mountmkdir mount\winpemkdir mount\setupmkdir x64_drivers

# move install.wim and boot.wim to C:\Inject

# move all drivers to x64_drivers

# expand nvidia driverscd C:\Path\to\nvidia-driversexpand *.* C:\Inject\x64_drivers

# mount images (boot and setup)cd "C:\Inject"dism /mount-wim /wimfile:boot.wim /index:1 /mountdir:mount\winpedism /mount-wim /wimfile:boot.wim /index:2 /mountdir:mount\setup

# retrieve driversdism /image:mount\winpe /get-driversdism /image:mount\setup /get-drivers

# inject driversdism /image:mount\winpe /add-driver /recurse /forceunsigned /driver:x64_driversdism /image:mount\setup /add-driver /recurse /forceunsigned /driver:x64_drivers

# verify driversdism /image:mount\winpe /get-driversdism /image:mount\setup /get-drivers

# Unmount and commitdism /unmount-wim /mountdir:mount\winpe /commitdism /unmount-wim /mountdir:mount\setup /commit

# Get Wiminfodism /get-wiminfo /wimfile:install.wim

# Make directotiesmkdir mount\enterprise

# Mount image editions (Actual windows)dism /mount-wim /wimfile:install.wim /index:1 /mountdir:mount\enterprise

# Verify indexes

Page 6: Windows ADK DISM commands to capture and apply images.doc

dism /get-mountedwiminfo

# Retrieve driversdism /image:mount\enterprise /get-drivers

# Inject driversdism /image:mount\enterprise /add-driver /recurse /forceunsigned /driver:x64_drivers

# Verify driversdism /image:mount\enterprise /get-drivers

# Unmount and commitdism /unmount-wim /mountdir:mount\enterprise /commit