coucou Posted July 12, 2011 Share Posted July 12, 2011 (edited) When you have integrated IE9, updates etc., you can use the compress.cmd given above!I've done like this for me.It's always needed to mount/unmount the image before to compress a new time without error with the same compression!Do not compress the install.wim image twice![TNX myselfidem and sorry if i'm repeating. I just want well understanding.1) In my case (described above), by using Export.cmd, I launched"C:\Program Files\Windows AIK\Tools\amd64\imagex.exe" /export C:\Win7\sources\install.wim 4 C:\Win7\sources\installnew.wim "Windows 7 ULTIMATE" /compress maximum /checkThen by using now (after integrated IE9, updates etc...) the compress.cmd I'll lauch again"C:\Program Files\Windows AIK\Tools\amd64\imagex.exe" /export C:\Win7\sources\install.wim 1 C:\Win7\sources\installv2.wim "Windows 7 ULTIMATE" /check /compress maximum And you warn me Do not compress the install.wim image 2) Do I have to mount my install.wim before compressing? Or, the compress.cmd will do the job?Regards Edited July 12, 2011 by coucou Link to comment Share on other sites More sharing options...
myselfidem Posted July 12, 2011 Share Posted July 12, 2011 (edited) You don't need to mount the install.wim image using the command /export.First you can use Export.cmd to save only one image (example: Ultimate).You can use compress.cmd after you have added IE9, updates, etc. and Unmount /Commit the image. But do not use twice when it's done! Use only one time compress.cmd!It's not needed to use twice => the result is the same: (example: before => 2 234 317 Ko and after compression => 2 091 057 Ko; and after another compression => 2 091 057 Ko)compress.cmd result using twice:C:\7elite32\batch>compress.cmdImageX Tool for WindowsCopyright © Microsoft Corp. All rights reserved.Version: 6.1.7600.16385Exporting: [C:\7elite32\source\sources\install.wim, 1] -> [C:\7elite32\source\sources\installv2.wim][ 100% ] Exporting progressSuccessfully exported image #1.Total elapsed time: 1 min 35 secAppuyez sur une touche pour continuer...C:\7elite32\batch>compress.cmdImageX Tool for WindowsCopyright © Microsoft Corp. All rights reserved.Version: 6.1.7600.16385Exporting: [C:\7elite32\source\sources\install.wim, 1] -> [C:\7elite32\source\sources\installv2.wim][ 100% ] Exporting progressSuccessfully exported image #1.Total elapsed time: 1 min 55 secAppuyez sur une touche pour continuer...If there is errors, it's better to save first install.wim image ( a copy) and after we can use (like this it's not needed to remove and rename manually the files):compress.cmd (we can use safely twice this batch file but it's not needed)@echo off & color 1F echo. "C:\Program Files\Windows AIK\Tools\x86\imagex.exe" /export C:\Win7\sources\install.wim 1 C:\Win7\sources\installv2.wim "Windows 7 ULTIMATE" /check /compress maximum echo. >nul timeout /t 3DEL /S /F /Q "C:\Win7\sources\install.wim"REN "C:\Win7\sources\installv2.wim" "install.wim"echo. pauseRegards*Edit: I will try to secure the batch file Export.cmd to not remove "install.wim" if we use twice the batch file!the command timeout /t 3 doesn't work on Windows XP. Edited July 15, 2011 by myselfidem Link to comment Share on other sites More sharing options...
coucou Posted July 12, 2011 Share Posted July 12, 2011 TNX myselfidem for yr patienceI'll try it and let you know Regards Link to comment Share on other sites More sharing options...
myselfidem Posted July 12, 2011 Share Posted July 12, 2011 If you have any other questions, maybe it's better to open a new topic? Link to comment Share on other sites More sharing options...
coucou Posted July 12, 2011 Share Posted July 12, 2011 Hi myselfidem,As promised, here the result after using compress.cmd for install.wimSze before 4.048.160 KBSize after 3.926.283 KBTNX again Link to comment Share on other sites More sharing options...
myselfidem Posted July 12, 2011 Share Posted July 12, 2011 (edited) Thanks coucou ! About Export.cmd, you can try (Like this if we use Export.cmd twice; the new install.wim image isn't removed) :WAIK for Windows 7 must be installed!Export.cmd@echo off & color 1Frem @myselfidem 07/30/2011SETLOCAL ENABLEEXTENSIONSecho.rem >nul taskkill /F /FI "WINDOWTITLE eq batch" rem (change the folder name 'batch' with the current window folder name, to close this one)echo.rem Allows using Dism.exe and cmd.exe with Administrator rights. >nul REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Windows\System32\Dism.exe" /t REG_SZ /d RUNASADMIN /f>nul REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Program Files\Windows AIK\Tools\Servicing\Dism.exe" /t REG_SZ /d RUNASADMIN /f>nul REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Windows\System32\cmd.exe" /t REG_SZ /d RUNASADMIN /fecho.clsTitle Exporting Image Windowsecho.color 1FMODE CON COLS=70 LINES=18clsecho.echo ========================================================echo = Exporting a single Image to save space for Windows 7 =echo ========================================================echo.echo WAIK 3.0 for Windows 7 must be installedecho.echo This batch file is useful to save and compress a singleecho image inside the same folder 'DVD\sources' to save space echo on your UA-DVD.echo.echo You can select your Windows 7 Edition (x86 or amd64).echo.echo.echo.echo.echo Press any Key to continue...&pause>nulecho.cls:startcolor 1FMODE CON COLS=70 LINES=70clsecho.echo =======================echo = Select Architecture =echo =======================echo.echo Example:amd64echo.set /p cb=Write Architecture and hit Enter:echo.if errorlevel 1 goto :errorecho.echo =====================echo = Select Image path =echo =====================echo.echo Example:C:\Wind7\sourcesecho.set /p source=Write image path:echo.echo.echo =============================echo = Image Name an Index Number=echo =============================echo.echo ------------------------------echo Examples: echo. echo a) NAME = Select Image Nameecho B) INDEX = Type 3 for Index: 3echo ------------------------------echo.echo 1) ULTIMATEecho 2) PROFESSIONALecho 3) HOMEPREMIUMecho 4) HOMEBASICecho 5) STARTERecho.echo -----------------------------------------------------echo Warning: Choose carefully the Image Nameecho.echo You can restart the process to change the image name.echo -----------------------------------------------------echo.echo 6) Return to Startecho.echo.choice /C 123456 /N /M "a) Select one of the options above (1-6)"if ERRORLEVEL 6 goto :startif ERRORLEVEL 5 set Flag=Windows 7 STARTERif ERRORLEVEL 4 set Flag=Windows 7 HOMEBASICif ERRORLEVEL 3 set Flag=Windows 7 HOMEPREMIUMif ERRORLEVEL 2 set Flag=Windows 7 PROFESSIONALif ERRORLEVEL 1 set Flag=Windows 7 ULTIMATEecho.set /p Index=B) Type Index Number and hit Enter:echo.if errorlevel 1 goto :errorecho.goto :workecho.:workcolor 1FMODE CON COLS=70 LINES=20clsecho.echo =====================echo = Windows 7 Edition = echo =====================echo. echo %Flag% %cb% index: %index%echo.echo -----------------echo Is this correct ?echo -----------------echo.echo 1) Yesecho 2) No. Changeecho.choice /C 12 /N /M "Select one of the options above (1 or 2)"if ERRORLEVEL 2 goto :startif ERRORLEVEL 1 goto :setokecho.:setokcolor 1FMODE CON COLS=70 LINES=40clsecho.echo =====================echo = Exporting image ...echo =====================echo.echo DON'T STOP the process. Please, wait...echo.set imgx="C:\Program Files\Windows AIK\Tools\%cb%\imagex.exe"%imgx% /info "%source%\install.wim" %index% >nulif errorlevel 1 goto :errorecho.if not exist "%source%\New" mkdir "%source%\New"echo.%imgx% /export %source%\install.wim %index% %source%\New\install.wim "%Flag%" /check /compress maximumecho.ping /n 3 127.0.0.1 >nulecho.IF EXIST "%source%\install.wim" DEL "%source%\install.wim"IF EXIST "%source%\New\install.wim" MOVE "%source%\New\install.wim" "%source%\install.wim"echo.if exist "%source%\New" rd /s /q "%source%\New"echo Press any Key to exit&pause>nul & goto :exitecho.:Errorcolor 4FMODE CON COLS=70 LINES=15clsecho.echo ------------echo Oops...ERROR echo ------------echo.echo 1) Select correct image path and index numberecho.echo 2) To compress again, select index:1echo.echo 3) Selected Image is already exportedecho.echo Please try again...echo.echo.echo Press any Key to exit&pause>nul & goto :exit:exit*Edit: Batch file Updated! Edited July 30, 2011 by myselfidem Link to comment Share on other sites More sharing options...
coucou Posted July 13, 2011 Share Posted July 13, 2011 TNX myselfidem,I'll give a try a next time. I presume this new Expot.cmd will works for both x32 and x64 (under Win7 only).Regards Link to comment Share on other sites More sharing options...
myselfidem Posted July 13, 2011 Share Posted July 13, 2011 (edited) TNX myselfidem,I'll give a try a next time. I presume this new Expot.cmd will works for both x32 and x64 (under Win7 only).RegardsYes, coucou ! Export.cmd is available for Windows 7 x86 or amd64 only!I've updated a new time the batch file to use easier! Edited July 13, 2011 by myselfidem Link to comment Share on other sites More sharing options...
coucou Posted July 13, 2011 Share Posted July 13, 2011 [ Export.cmd is available for Windows 7 x86 or amd64 only! But you can use under Windows XP!I've updated a new time the batch file to use easier! Do I well understand that Export.cmd could be used under Win7 and/or WinXP? Regards Link to comment Share on other sites More sharing options...
myselfidem Posted July 13, 2011 Share Posted July 13, 2011 (edited) [ Export.cmd is available for Windows 7 x86 or amd64 only! But you can use under Windows XP!I've updated a new time the batch file to use easier! Do I well understand that Export.cmd could be used under Win7 and/or WinXP? RegardsNo, sorry! The command "choice" doesn't work under Windows XP! It's needed to adapt the batch file to do the choice!I've updated my last post!Export.cmd given above works only under Win7!With OS Windows XP, we can use this batch file:Export.cmd (under Windows XP):@echo off & color 1Fecho.echo Customizing Windows 7 images, under Windows XPecho WAIK 3.0 for Windows 7 must be installed echo.SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSIONecho.echo =======================echo = Select Architecture =echo =======================echo.echo Example:amd64echo.set /p cb=Architecture:echo.if errorlevel 1 goto :errorecho.echo ======================echo = Select Image path =echo ======================echo.echo Example:C:\Wind7\sourcesecho.set /p source=Write the image path:echo.echo ==============echo = Image name =echo ==============echo.echo Examples: echo.echo Windows 7 ULTIMATEecho Windows 7 PROFESSIONALecho Windows 7 HOMEPREMIUMecho Windows 7 HOMEBASICecho Windows 7 STARTERecho.set /p image=Write the image name:echo.echo ===============echo = Image Index =echo ===============echo.set /p index=Set image index:echo.echo Selected Windows version : %image% %cb% index: %index%echo. set imgx="C:\Program Files\Windows AIK\Tools\%cb%\imagex.exe"%imgx% /info "%source%\install.wim" %index% >nulif errorlevel 1 goto :nextecho.%imgx% /export %source%\install.wim %index% %source%\installv2.wim "%image%" /check /compress maximumping /n 3 127.0.0.1 >nulecho.DEL /S /F /Q "%source%\install.wim"REN "%source%\installv2.wim" "install.wim"echo.goto :exitecho.:nextecho The selected Image is already exported.echo After adding updates, etc. you can compress your new image.echo Please try again...And, Select index:1 echo.echo Press any Key to exit&pause>nulgoto :exitecho.:Errorcolor 4FMODE CON COLS=70 LINES=15clsecho.echo ------------echo Oops...ERROR echo ------------echo.echo Please, select correct architecture and image path.echo.echo.echo And try again...echo.echo.echo Press any Key to exit&pause>nulgoto :exit:exit*Edit: batch file updated Edited July 18, 2011 by myselfidem Link to comment Share on other sites More sharing options...
coucou Posted July 13, 2011 Share Posted July 13, 2011 TNX myselfidem Now, i'ts clear enough Link to comment Share on other sites More sharing options...
myselfidem Posted July 17, 2011 Share Posted July 17, 2011 (edited) Thanks coucou ! For boot.wim, we can use:Export_Boot.cmd@echo off & color 1Frem @myselfidem 07/30/2011SETLOCAL ENABLEEXTENSIONSecho.rem >nul taskkill /F /FI "WINDOWTITLE eq batch"rem (change the folder name 'batch' with the current window folder name, to close this one)echo.rem Allows using Dism.exe and cmd.exe with Administrator rights. >nul REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Windows\System32\Dism.exe" /t REG_SZ /d RUNASADMIN /f>nul REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Program Files\Windows AIK\Tools\Servicing\Dism.exe" /t REG_SZ /d RUNASADMIN /f>nul REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Windows\System32\cmd.exe" /t REG_SZ /d RUNASADMIN /fecho.clsTitle Exporting Boot.wim Imagesecho.color 1FMODE CON COLS=70 LINES=18clsecho.echo =========================================================echo = Exporting Boot.wim Images to save space for Windows 7 =echo =========================================================echo.echo WAIK 3.0 for Windows 7 must be installedecho.echo This batch file is useful to save and compress images insideecho the same folder 'DVD\sources' to save space for your UA-DVD.echo.echo You can select your Windows 7 Edition (x86 or amd64).echo.echo.echo.echo.echo Press any Key to continue...&pause>nulecho.cls:startcolor 1FMODE CON COLS=70 LINES=20clsecho.echo =======================echo = Select Architecture =echo =======================echo.echo Example:amd64echo.set /p cb=Type Architecture an hit Enter:echo.if errorlevel 1 goto :errorecho.echo.echo.echo =========================echo = Select the Image path =echo =========================echo.echo Example: C:\Wind7\sourcesecho.set /p source=Write image path:echo.if errorlevel 1 goto :errorecho.color 2fMODE CON COLS=70 LINES=20clsecho.echo ==============echo = Image path = echo ==============echo. echo.echo Architecture:%cb% echo.echo Image path:%source%echo.echo.echo -----------------echo Is this correct ?echo -----------------echo.echo 1) Yesecho 2) No. Changeecho.choice /C 12 /N /M "Select one of the options above (1 or 2)"if ERRORLEVEL 2 goto :startif ERRORLEVEL 1 goto :work:workcolor 1FMODE CON COLS=70 LINES=50clsecho.echo ==============================echo = Exporting Boot.wim images...echo ==============================echo.set imgx="C:\Program Files\Windows AIK\Tools\%cb%\imagex.exe"%imgx% /info "%source%\boot.wim" %index% >nulif errorlevel 1 goto :errorecho.if not exist "%source%\New" mkdir "%source%\New"echo.%imgx% /export %source%\boot.wim * %source%\New\boot.wim /boot /check /compress maximumecho.ping /n 3 127.0.0.1 >nulecho.IF EXIST "%source%\boot.wim" DEL "%source%\boot.wim"IF EXIST "%source%\New\boot.wim" MOVE "%source%\New\boot.wim" "%source%\boot.wim"echo.if exist "%source%\New" rd /s /q "%source%\New" echo. echo ----------------------------echo Do you want compress again ?echo ----------------------------echo.echo 1) Yesecho 2) No. Exitecho.choice /C 12 /N /M "Select one of the options above (1 or 2)"if ERRORLEVEL 2 goto :exitif ERRORLEVEL 1 goto :workecho.:Errorcolor 4FMODE CON COLS=70 LINES=15clsecho.echo ------------echo Oops...ERROR echo ------------echo.echo Please, select correct architecture and image path.echo.echo And try again...echo.echo.echo.echo Press any Key to exit&pause>nul & goto :exit:exit*Edit: Batch file Updated! Edited July 30, 2011 by myselfidem Link to comment Share on other sites More sharing options...
coucou Posted July 18, 2011 Share Posted July 18, 2011 TNX myselfidem for this useful boot batch BTW, have you any idea what could be the following message I get, when I try to (RE)activate my VMWare WIN7Regards Link to comment Share on other sites More sharing options...
myselfidem Posted July 18, 2011 Share Posted July 18, 2011 (edited) Have you trying to re-activate Windows 7 with slui.exe on VMWare?I think this error can occurs because you are testing on a Virtual Machine! Edited July 18, 2011 by myselfidem Link to comment Share on other sites More sharing options...
coucou Posted July 18, 2011 Share Posted July 18, 2011 Do you know what should be the re-activate Windows 7 command with slui.exe? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now