Jump to content


Photo

How to use Windows 7 DISM by Muiz


  • Please log in to reply
21 replies to this topic

#1 muiz

muiz

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts
  • OS:Windows 7 x64

Posted 26 November 2008 - 01:27 AM

How to use Windows 7 DISM by Muiz.

Q : What is DISM?
A : Deployment Image Servicing and Management (DISM)

Q : Why this guide?
A : Cause there is NO information about this tool out yet.

DISM is the replacement for the older deployment tools from Microsoft, like PKMGR and PEIMG
WAIK doesnt support this yet, so when you want to use WAIK, use it from a Vista or XP, not from a Windows 7
When you work from Windows 7, you dont need to install DISM, cause its already in it.
You can basicly do anything to your image with DISM, even aplly unattended settings to it , so you can use it unattended without XML.
How to get DISM?
Mount your Windows 7 and go to the System32 folder of the ofline image, and copy the "DISM" folder and "DISM.exe" to your Vista System32 folder.
Register the dll's inside(Some cant be registered)

Dll's :

CbsProvider.dll
CompatProvider.dll
DismCore.dll
DismCorePS.dll
DismProv.dll
DmiProvider.dll
IntlProvider.dll
MsiProvider.dll
SmiProvider.dll
UnattendProvider.dll
WimProvider.dll

For x64 users, you also have to grab the "SysWOW64" folder and the "DISM.exe" from there.

What i did was also added "DISM.exe" to my WAIK folder to make it even more easy to use.


Here is a small list with commands and a few examples, what you can do with dism.
You can get the example of each command by putting "/?" without the quotes after the command.
I did a few in this guide, but you can do this for each command.

----------------------------------------------------------------------------------------------------------------------
DISM.exe [dism_options] {WIM_command} [<WIM_arguments>]
DISM.exe {/Image:<path_to_offline_image> | /Online} [dism_options]
		 {servicing_command} [<servicing_arguments>]

DESCRIPTION:

  DISM enumerates, installs, uninstalls, configures, and updates features
  and packages in Windows images. The commands that are available depend
  on the image being serviced and whether the image is offline or running.

WIM COMMANDS:

  /Get-MountedWimInfo	 - Displays information about mounted WIM images.
  /Get-WimInfo			- Displays information about images in a WIM file.
  /Commit-Wim			 - Saves changes to a mounted WIM image.
  /Unmount-Wim			- Unmounts a mounted WIM image.
  /Mount-Wim			  - Mounts an image from a WIM file.
  /Remount-Wim			- Recovers an orphaned WIM mount directory.
  /Cleanup-Wim			- Deletes resources associated with mounted WIM
							images that are corrupt.

Examples :

-------------------------------------------------------------------------------------
/Mount-Wim /WimFile:<path_to_WIM_file> {/Index:<image_index> | /Name:<image_name
>}
  /MountDir:<target_mount_directory> [/readonly]

  Mounts the WIM file to the specified directory so that it is available for
  servicing. /ReadOnly sets the mounted image with read-only permissions.

	Examples:
	  DISM.exe /Mount-Wim /WimFile:C:\test\images\myimage.wim /index:1
		/MountDir:C:\test\offline

	  DISM.exe /Mount-Wim /WimFile:C:\test\images\myimage.wim /index:1
		/MountDir:C:\test\offline /ReadOnly

-------------------------------------------------------------------------------------
/ScratchDir:<path_to_directory>

  Specifies a temporary directory to be used for extracting files for
  servicing. The directory must exist.

  If not set, the temporary directory will be used.

	Example:
	  DISM.exe /Image:C:\test\offline /scratchdir:D:\Scratch

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

-------------------------------------------------------------------------------------




IMAGE SPECIFICATIONS:

  /Online				 - Targets the running operating system.
  /Image				  - Specifies the path to the root directory of an
							offline Windows image.

DISM OPTIONS:

  /WinDir				 - Specifies the path to the Windows directory.
  /SysDriveDir			- Specifies the path to the system-loader file named
							BootMgr.
  /LogPath				- Specifies the logfile path.
  /LogLevel			   - Specifies the output level shown in the log (1-4).
  /NoRestart			  - Suppresses automatic reboots and reboot prompts.
  /Quiet				  - Suppresses all output except for error messages.
  /ScratchDir			 - Specifies the path to a scratch directory.

For more information about these DISM options and their arguments, specify an
option immediately before /?.

  Examples:
	DISM.exe /Mount-Wim /?
	DISM.exe /ScratchDir /?
	DISM.exe /Image:C:\test\offline /?
	DISM.exe /Online /?




WINDOWS EDITION SERVICING COMMANDS:

  /Set-ProductKey		 - Populates the product key into the offline image.
  /Get-CurrentEdition	 - Displays the editions of the specified image.
  /Get-StagedEditions	 - Displays a list of Windows editions that can be
							removed from the specified image.
  /Get-TargetEditions	 - Displays a list of Windows editions that an
							image can be upgraded to.
  /Remove-StagedEdition   - Removes a staged edition from the 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.

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 /?

/Apply-Unattend:<path_to_unattend.xml>

  Applies an unattend.xml file to an offline image or a running operating
  system.

	Examples:
	  DISM.exe /Image:C:\test\offline /Apply-Unattend:C:\unattend.xml
	  DISM.exe /Online /Apply-Unattend:C:\unattend.xml\

-------------------------------------------------------------------------------

/Get-Features [/PackagePath:<path_to_package>] [/PackageName:<name_in_image>]

  Displays information about all features found in a specific package.
  If you do not specify a package name or path, all features in the image will
  be listed. /PackagePath can point to either a .cab file or a folder.

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

	  DISM.exe /Image:C:\test\offline /Get-Features
		/PackagePath:C:\packages\package.cab

	  DISM.exe /Image:C:\test\offline /Get-Features
		/PackageName:Microsoft.Windows.Calc.Demo~6595b6144ccf1df~x86~en~1.0.0.0
---------------------------------------------------------------------------------

/Get-Drivers [/all]

  Displays information about drivers in an image. Only shows out-of-box drivers
  by default. Use /all switch to show all drivers in the image.

	Example:
	  DISM.exe /Image:C:\test\offline /Get-Drivers
	  DISM.exe /Image:C:\test\offline /Get-Drivers /all
---------------------------------------------------------------------------------

This is the beginning of a bigger guide, but it will do for now.

Author : Muiz
Credits : Muiz

Edited by muiz, 06 December 2008 - 09:41 AM.

  • NIM likes this

#2 shahed

shahed

    WinCert Friend

  • Members
  • PipPipPipPip
  • 279 posts
  • Location:East London
  • OS:Windows 7 x64

Posted 26 November 2008 - 01:32 AM

Excellent guide muiz. Thank you very much, very handy indeed.

#3 AMIRZ

AMIRZ

    Loyal Member and Friend

  • Contributors
  • 517 posts
  • Location:Jakarta
  • OS:Windows 7

Posted 08 December 2008 - 03:55 AM

Thx alot, very informative and useful :thumbsup_anim:

#4 muiz

muiz

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts
  • OS:Windows 7 x64

Posted 12 December 2008 - 10:22 AM

No problem :icon_cool:

#5 swbchen

swbchen

    Lurker

  • Members
  • Pip
  • 6 posts
  • Location:Taiwan
  • OS:Windows XP Pro

Posted 31 January 2009 - 11:11 AM

Where can I download Windows 7 Toolkit(W7T) ???

Edited by swbchen, 31 January 2009 - 11:11 AM.


#6 snakecracker

snakecracker

    Who Dares Wins

  • Members
  • PipPipPipPipPipPip
  • 738 posts
  • Location:London, England
  • OS:Windows 7 x64

Posted 31 January 2009 - 11:20 AM

its not out yet. (i think)

this topic could be moved to Win 7?

#7 NIM

NIM

    Vigilant

  • Administrator
  • 3,924 posts
  • OS:Windows 8 x64

Posted 31 January 2009 - 01:05 PM

Where can I download Windows 7 Toolkit(W7T) ???

Please don't double post again.

#8 Jatin Beniwal

Jatin Beniwal

    WinCert Friend

  • W7T Addon Maker
  • 285 posts
  • Location:India

Posted 31 March 2009 - 01:00 AM

Superb Guide

#9 Sven

Sven

    Member

  • Members
  • PipPip
  • 25 posts
  • Location:┼kersberga
  • OS:Windows 7 x64

Posted 22 August 2009 - 02:41 PM

I try to add key into the offline image

Dism /Mount-WIM /WimFile:E:\DVD\sources\install.wim /Name:"Windows 7 ULTIMATE" /MountDir:E:\Mount <<---- work mounting

Dism /Image:E:\Mount /Set-ProductKey:12345-ABCDE-67890-FGHIJ-XXXXX <<--- add key don't work "fake key"

Dism /Unmount-WIM /MountDir:E:\Mount /Commit <<--- work unmounting

I try to fig out how i works.
I need som help.

#10 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 8,627 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 22 August 2009 - 03:46 PM

I try to add key into the offline image

Dism /Mount-WIM /WimFile:E:\DVD\sources\install.wim /Name:"Windows 7 ULTIMATE" /MountDir:E:\Mount <<---- work mounting

Dism /Image:E:\Mount /Set-ProductKey:12345-ABCDE-67890-FGHIJ-XXXXX <<--- add key don't work "fake key"

Dism /Unmount-WIM /MountDir:E:\Mount /Commit <<--- work unmounting

I try to fig out how i works.
I need som help.

Try using /index when mounting and sometimes adding a backslash (\) to the end of the mount dir path helps, for example:

dism /image:e:\mount\ /set-productkey:12345-ABCDE-67890-FGHIJ-XXXXX


#11 Mr_Smartepants

Mr_Smartepants

    DriverPacks.net Administrator

  • Members
  • PipPipPipPipPipPip
  • 814 posts
  • Location:Cambridgeshire
  • OS:Windows 7

Posted 22 August 2009 - 04:03 PM

Yes, the /index or /name is mandatory now with dism.

Dism /Mount-Wim /WimFile:C:\test\images\install.wim /index:1 /MountDir:C:\test\offline /ReadOnly

Dism /Mount-Wim /WimFile:C:\test\offline\install.wim /name:"Windows Vista HomeBasic" /MountDir:C:\test\offline
Note: An index or name value is required for most operations that specify a WIM file.


Edited by Mr_Smartepants, 22 August 2009 - 04:05 PM.


#12 Sven

Sven

    Member

  • Members
  • PipPip
  • 25 posts
  • Location:┼kersberga
  • OS:Windows 7 x64

Posted 22 August 2009 - 04:38 PM

Tnx
Dism /Mount-WIM /WimFile:E:\DVD\sources\install.wim /index:4 /MountDir:E:\Mount <<--- working "ultimate"

Dism /Image:E:\Mount /Set-ProductKey:12345-ABCDE-67890-FGHIJ-XXXXX <<--- add key work "fake key"

Starting to install product key...
Finished installing produkt key.

Tnx all :thumbsup_anim:

Edited by Sven, 23 August 2009 - 05:53 AM.


#13 ricktendo

ricktendo

    Group: Banned

  • Global Mods
  • 8,627 posts
  • Location:La Ceiba
  • OS:Windows 8 x64

Posted 22 August 2009 - 05:05 PM

So what did the trick, was it /index or adding a backslash to the end of the /image path?

#14 Sven

Sven

    Member

  • Members
  • PipPip
  • 25 posts
  • Location:┼kersberga
  • OS:Windows 7 x64

Posted 22 August 2009 - 07:22 PM

it was /index

Edited by Sven, 22 August 2009 - 07:23 PM.


#15 Raoul

Raoul

    WinCert Friend

  • Members
  • PipPipPipPip
  • 274 posts
  • Location:The Netherlands
  • OS:Windows 7

Posted 23 August 2009 - 01:56 PM

Ah im gonna try that, thanks! :)

#16 The444

The444

    Lurker

  • Members
  • Pip
  • 2 posts
  • OS:non-selected

Posted 20 April 2010 - 10:17 AM

Is there a way we can remove the Language packs ?

#17 Mr_Smartepants

Mr_Smartepants

    DriverPacks.net Administrator

  • Members
  • PipPipPipPipPipPip
  • 814 posts
  • Location:Cambridgeshire
  • OS:Windows 7

Posted 20 April 2010 - 11:00 AM

Is there a way we can remove the Language packs ?


Google is your friend! :google_lt:
http://technet.micro...28WS.10%29.aspx

Edited by Mr_Smartepants, 20 April 2010 - 11:03 AM.


#18 The444

The444

    Lurker

  • Members
  • Pip
  • 2 posts
  • OS:non-selected

Posted 20 April 2010 - 12:55 PM

Found it m8

To remove a language pack using DISM


1. Locate the Windows image (.wim) file that contains the Windows images that you intend to remove languages from.

2. Click Start, point to All Programs, point to Windows OPK or Windows AIK, right-click Deployment Tools Command Prompt, and then select Run as administrator.

3. At the command prompt, type the following command to retrieve the name or index number for the image you want to modify.

Dism /Get-WIMInfo /WimFile:C:\test\images\install.wim

An index or name value is required for most operations that specify a .wim file.

4. Type the following command to mount the offline Windows image.

Dism /Mount-WIM /WimFile:C:\test\images\install.wim /Name:"Windows 7 HomeBasic" /MountDir:C:\test\offline

5. Optional: Type the following command to list the languages in the offline image.

Dism /Image:C:\test\offline /Get-Intl

6. Type the following command to remove a language pack from the image. You can remove multiple .cab files using one command-line statement.

Dism /Image:C:\test\offline /Remove-Package /PackagePath:C:\packages\package1.cab /PackagePath:C:\packages\package2.cab ...

7. Type the following command to commit the changes. The image remains mounted until the /unmount option is used.

Dism /Commit-Wim /MountDir:C:\test\offline

8. The language packs are removed from your image.

#19 crashfly

crashfly

    WinCert Pro

  • Members
  • PipPipPipPipPip
  • 400 posts
  • Location:Arkansas, USA
  • OS:Windows 7 x64

Posted 29 July 2010 - 03:14 AM

Is there a way to compress the "finished" wim file with DISM? (or should imagex be used to export a 'compressed' image?)

#20 Kelsenellenelvian

Kelsenellenelvian

    Master of my domain!

  • Global Mods
  • 3,027 posts
  • Location:U.S.A.
  • OS:Windows 7 x64

Posted 29 July 2010 - 03:20 AM

DISM has no comression settings.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users