Se necesitan unos requisitos y dependencias para usar este Script:
· Saber de lo que estoy hablando.
· Conocer el nombre de las características que quieres elimiar (obviamente).
· Dism e ImageX (WAIK/WADK).
Las instrucciones de uso y un extenso tutorial lo publiqué en este otro tema: http://foro.elhacker.net/windows/guia_de_personalizacion_de_imagenes_de_implementacion_de_windows_wim_parte_5-t412551.0.html así que lo haré de nuevo de manera resumida: solo tienen que escribir en un archivo de texto el nombre de las características que quieren desactivar, y configurar las variables documentadas del Script (La ubicación de la imagen, el directorio de montaje, etc...)
Todo lo necesario está incluido en este archivo comprimido:
http://www.mediafire.com/download/lq4sc56ri59klod/WIM_Feature_Uninstaller.rar
Imágenes:
WIM Feature Uninstaller.cmd
Código
@Echo OFF REM ================= REM Console Settings: REM ================= Title WIM Feature Uninstaller - By Elektro Mode Con Cols=150 Lines=50 REM ===== REM Info: REM ===== Echo+ Echo ----------------------------------------------------------------------------- Echo ----------------------------------------------------------------------------- Echo+ REM ==================== REM User defined values: REM ==================== REM This value indicates whether the Windows Image should be mounted. REM True = 'DISM' will try to mount the 'WIM' image. REM False = 'DISM' will not try to mount the WIM image. REM Set this value to 'FALSE' if the 'WIM' image is already mounted in the specified mount directory, REM Otherwise, keep it as 'TRUE'. Set "MountImage=True" REM This value indicates whether the Windows Image should be unmounted at the end. REM True = 'DISM' will try to unmount the 'WIM' image. REM False = 'DISM' will not try to unmount the WIM image. REM Set this value to 'FALSE' if you want to keep the image mounted to make other changes, REM Otherwise, keep it as 'TRUE'. Set "UnmountImage=True" REM This value indicates whether the Windows Image should be rebuilt at the end. REM True = 'ImageX' will try to rebuild the 'WIM' image. REM False = 'ImageX' will keep the 'WIM' image as is. REM Set this value to 'FALSE' if you want to keep the image with normal size to make other changes, REM Otherwise, keep it as 'TRUE'. Set "Rebuild=True" REM This value indicates the 'WIM' image to be mounted. REM This value indicates the Image Index of the 'WIM' image. Set "ImageIndex=1" REM This value indicates the directory where to mount the 'WIM' image. REM This value indicates the textfile that contains the names of the features to disable. REM This value indicates the ubication of 'ImageX.exe' file. REM This value indicates the ubication of a custom 'DISM.exe' file if needed. REM Default ubication: "%SystemRoot%\System32\Dism.exe" REM This value indicates the ubication of the logfile that will record 'DISM' errors. REM This value indicates the logging-level of the 'DISM' process. REM 1 = Errors only REM 2 = Errors and warnings REM 3 = Errors, warnings, and informational REM 4 = All of the information listed previously, plus debug output Set /A "DismLogLevel=2" REM This value indicates the ubication of the logfile that will record Main information. REM ===== REM Main: REM ===== :: Call Methods. Call :CheckErrors Call :CreateLogs Call :CreateMountDir Call :GetWIMSizeBefore Call :StartTimer Call :Mount CLS Call :ParseFeatures CLS Call :CleanUp Call :Unmount Call :Rebuild Call :StopTimer Call :GetWIMSizeAfter Call :EndLog Pause&Exit REM ======== REM Methods: REM ======== :CreateLogs :: Create the 'DISM' logfile with 'ANSI' encoding, :: this is necessary to record a non-default 'DISM' loglevel such as '1' or '2'. :: Create the Main logfile and record starting info on it. ( Echo+ Echo WIM Feature Uninstaller Echo =========================== Echo /\/\/\/\/\/\/\/\/\/\/\/\/\/ Echo+ Echo+ Echo+ Echo+ Echo+ Echo =========================== )>"%Logfile%" :: Display starting log info. Type "%Logfile%" :: Continue writting log. ( Echo+ Echo Feature conflicts: Echo ================== Echo+ )>>"%LogFile%" Goto:EOF :EndLog ( Echo+ Echo [i] Done! Echo+ )>>"%LogFile%" :: Display ending information. CLS Type "%LogFile%" Goto:EOF :CreateMountDir :: Create the mount directory. ( ) ) || ( Echo+ Echo [i] Ensure that you have Admin rights to create the directory. Echo+ Pause&Exit ) Goto:EOF :Mount :: Mount the Windows Image into the directory. Echo+ Echo [+] Mounting WIM Image... "%Dism%" /Mount-Image /ImageFile:"%WindowsImage%" /Index:"%ImageIndex%" /MountDir:"%MountDir%" /English /LogPath:"%DismLogfile%" /LogLevel:"%DismLogLevel%" || ( Echo+ Echo [i] Ensure that you have Admin rights to write inside the directory. Echo [i] Ensure that the directory is fully empty. Echo+ REM Try to unmount the failed image and discard changes. Echo [+] Unmounting and discarding changes... "%Dism%" /Unmount-WIM /Discard /MountDir:"%MountDir%" ) Pause&Exit ) ) Goto:EOF :CleanUp Echo [+] CleaningUp WIM Image... "%Dism%" /CleanUp-Image /StartComponentCleanUp /Image:"%MountDir%" /English /LogPath:"%DismLogfile%" /LogLevel:"%DismLogLevel%" /Quiet Echo+ Goto:EOF :Unmount :: Unmount the Windows Image commiting changes. Echo [+] Unmounting WIM Image... "%Dism%" /Unmount-WIM /Commit /MountDir:"%MountDir%" /English /LogPath:"%DismLogfile%" /LogLevel:"%DismLogLevel%" ) Goto:EOF :Rebuild Echo+ Echo [+] Rebuilding WIM image... ("%ImageX%" /Compress Maximum /Export "%WindowsImage%" "*" "%TEMP%\Rebuilt Image.wim" /Check) && ( ) || ( ) Goto :EOF :StartTimer Goto :EOF :StopTimer ( )>"%TEMP%\%~n0 MinuteDiff.vbs" 'Cscript.exe /Nologo "%TEMP%\%~n0 MinuteDiff.vbs"' ) Goto:EOF :WriteConvertBytesScript ( Echo+ Echo End Function Echo+ Echo Level = Level + 1 Echo End Function Echo+ )>"%TEMP%\%~n0 Convert Bytes.vbs" Goto:EOF :GetWIMSizeBefore Call :WriteConvertBytesScript 'Cscript.exe /Nologo "%TEMP%\%~n0 Convert Bytes.vbs" "%WIMSizeBefore%"' ) Goto:EOF :GetWIMSizeAfter Call :WriteConvertBytesScript 'Cscript.exe /Nologo "%TEMP%\%~n0 Convert Bytes.vbs" "%WIMSizeAfter%"' ) Goto:EOF :ParseFeatures Set /A "FeaturesRemovedCount=0" Set /A "FeaturesFailedCount=0" Set /A "FeaturesNotFoundCount=0" :: Disable Features. "%Dism%" /Disable-Feature /FeatureName:"%%~#" /Image:"%MountDir%" /English /LogPath:"%DismLogfile%" /LogLevel:"%DismLogLevel%" /Quiet 1>NUL ) ) ) ) Goto:EOF REM =============== REM Error Controls: REM =============== :CheckErrors :: WIM File Error-Check. Pause&Exit ) :: FeatureList File Error-Check. Pause&Exit ) :: 'DISM.exe' File Error-Check. Pause&Exit ) :: 'ImageX.exe' File Error-Check. Pause&Exit ) :: 'MountImage' Value check. Echo [x] Error parsing parameter 'MountImage', Pause&Exit ) :: 'UnmountImage' Value check. Echo [x] Error parsing parameter 'UnmountImage', Pause&Exit ) :: 'Rebuild' Value check. Echo [x] Error parsing parameter 'Rebuild', Pause&Exit ) :: 'DismLogLevel' Value check. Echo [x] Error parsing parameter 'DismLogLevel', Pause&Exit ) Goto:EOF