tommy_vercetti
Herald
Hi,
Have you ever wanted to remove some components of your OS, with Windows 7 you can do that, here's how
In this particular instance we will work with Windows 7 Pro should work with other versions as well, if you are on Windows 7 no additional software is required, if not then you need to have WAIK
Once that is installed then you can use DISM, the tool which makes it possible, we need the install.wim from the Windows 7 DVD, it should be in the sources folder
For this example we will be using the following folders, you can put then in any drive, for purpose of simplicity I put them in C drive
Sources -> containing the install.wim
Drivers -> containing drivers if you wish to slipstream/integrate them
Updates -> containg any updates you wish to slipstream/integrate them
Log -> very essential to check what's going on
All set, lets start !
Have you ever wanted to remove some components of your OS, with Windows 7 you can do that, here's how
In this particular instance we will work with Windows 7 Pro should work with other versions as well, if you are on Windows 7 no additional software is required, if not then you need to have WAIK
Once that is installed then you can use DISM, the tool which makes it possible, we need the install.wim from the Windows 7 DVD, it should be in the sources folder
For this example we will be using the following folders, you can put then in any drive, for purpose of simplicity I put them in C drive
Sources -> containing the install.wim
Drivers -> containing drivers if you wish to slipstream/integrate them
Updates -> containg any updates you wish to slipstream/integrate them
Log -> very essential to check what's going on
All set, lets start !
Code:
You need to run this from the command prompt as Adminstrator
DISM.exe /Get-Wiminfo /WimFile:C:\Sources\install.wim
# Gives you information and editions present in the install.wim#
DISM.exe /Mount-Wim /WimFile:C:\Sources\install.wim /index:3 /MountDir:C:\Mount
# Mount's the specified edition of Windows 7 in this case 3 which Pro, 4 is Ultimate and so on...#
DISM.exe /Image:C:\Mount /Add-Driver:C:\Drivers /recurse
# Will add all the drivers from the folder Drivers in the C drive including subfolders#
DISM.exe /Image:C:\Mount /Get-Drivers > C:\Log\Drivers.txt
# Will dump all the installed drivers successful or not in the Drivers.txt file#
DISM.exe /Image:C:\Mount /Add-Package:C:\Updates
# Will install all the updates(.msu packages) from the updates folder#
DISM.exe /Image:C:\Mount /Get-Features | more
# Will list all the features installed in the mounted version of the OS#
DISM.exe /Image:C:\Mount /Get-Features > C:\Log\Features.txt
# Will list all the features installed in the mounted version of the OS in the Features.txt file#
DISM.exe /Image:C:\Mount /Disable-Feature /FeatureName:
# By going through the above command/ or the Features.txt you can find the status of the installed features enabled or disabled. Now I have till now never used the Windows Media Center and think I have no use for it, also the Internet Printing so in this example I will show you have to disable them#
DISM.exe /Image:C:\Mount /Disable-Feature /FeatureName:MediaCenter
DISM.exe /Image:C:\Mount /Disable-Feature /FeatureName:TabletPCOC
DISM.exe /Image:C:\Mount /Disable-Feature /FeatureName:Printing-Foundation-Features
DISM.exe /Image:C:\Mount /Disable-Feature /FeatureName:Printing-Foundation-InternetPrinting-Client
DISM.exe /Image:C:\Mount /Disable-Feature /FeatureName:FaxServicesClientPackage
DISM.exe /Image:C:\Mount /Get-Features > C:\Log\FeaturesD.txt
# Running this again to figure out what was disabled#
You might want to enable some features like the Telnet client to telnet or for troubleshooting purpose
DISM.exe /Image:C:\Mount /Enable-Feature:TelnetClient
# This will enable the Telnet Client, you can do so for the Telnet Server as well but not recommended and is a security risk on the Internet#
Time to save all the hard work
DISM.exe /Unmount-Wim /MountDir:C:\Mount /commit
# Trust me this will look like it is not working, but it takes approximately more than 30-45 minutes to complete, might take longer too...#
Once is gives you the completed successfully message you can again copy the install.wim in to your Windows 7 DVD and the install it
How do you make it bootable, if you have WAIK installed you can use the oscdimg.exe using the following command
-b"C:\GRMCULXFRER_EN_DVD\boot\etfsboot.com" -h -u2 -m -lGRMCULXFRER_EN_DVD
"C:\GRMCULXFRER_EN_DVD" "E:\GRMCULXFRER_EN_DVD.iso"
For the geeks
#Deployment Image Servicing and Management tool
Version: 6.1.7100.0
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.
IMAGE SPECIFICATIONS:
/Online - Targets the running operating system.
/Image - Specifies the path to the root directory of an
offline Windows image.
DISM OPTIONS:
/English - Displays command line output in English.
/Format - Specifies the report output format.
/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.
What is interesting about the DISM help is that it doesnt give you all of the options. You have to specify the /online switch
to see the other options.
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#
This is my post with information from various different posts from the interent.