Changing WIM info?

Discussion in 'Windows 7' started by DKane, Jun 1, 2010.

  1. DKane

    DKane MDL Junior Member

    Sep 18, 2009
    63
    63
    0
    #1 DKane, Jun 1, 2010
    Last edited: Jun 1, 2010
    I'm compiling a custom install.wim, with images for all editions of Windows 7. Is there any way to edit the XML property sheet inside the image? More specifically the [display]name/description?

    EDIT: I know the name/description can be changed with imagex, but for some reason it doesn't seem to touch the display name/description
     
  2. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,354
    632
    60
    This may help, batch file run it under winpe

    @echo off
    cd /d %~dp0
    set imgx=%cd%
    if not exist "%cd%\imagex.exe" goto _notexist
    goto _main

    :_notexist
    echo.
    echo IMAGEX.EXE executable not found. Please ensure that imagex_capture.cmd
    echo is in the same folder as IMAGEX.EXE before executing this script.
    echo This script will now exit.
    echo.
    pause
    exit

    :_main
    echo.
    echo.
    echo.
    echo [I M A G E X C A P T U R E / A P P E N D M A I N M E N U]
    echo.
    echo 1) Specify or change source path, the path you want to capture (e.g. C:\)
    echo Source: [%_csource%]
    echo.
    echo 2) Specify or change target image to create/append (e.g. d:\myimage.wim)
    if "%_append%"=="yes" echo *Image will be appended unless you specify a non-existing image file.*
    echo Target: [%_ctarget%]
    echo.
    echo 3) Specify or change unique description of your image (e.g. Vista Backup)
    echo Description: [%_descript%]
    echo.
    echo 4) Specify or change FLAG of your image (e.g. ULTIMATE)
    echo FLAG: [%_FLAG%]
    echo.
    echo 5) Specify or change compression type (maximum, fast, none)
    echo Compression: [%_compr%]
    echo.
    if "%_csource%" == "" goto _menu1
    if "%_ctarget%" == "" goto _menu1
    if "%_descript%" == "" goto _menu1
    if "%_append%" == "yes" goto _skip
    if "%_FLAG%" == "" goto _menu1
    if "%_compr%" == "" goto _menu1
    :_skip
    echo 6) Capture or append your image now when ready
    echo From [%_csource%] To [%_ctarget%]
    echo.

    :_menu1
    echo Q) Quit. R) Reset all variables
    echo.

    :_mainch
    set _ok=
    set /p _ok=Enter your choice:
    if "%_ok%" == "1" goto _getsrc
    if "%_ok%" == "2" goto _gettarget
    if "%_ok%" == "3" goto _getdescript
    if "%_ok%" == "4" goto _getFLAG
    if "%_ok%" == "5" goto _getcompr
    if "%_ok%" == "6" goto _capture
    if /I "%_ok%" == "q" goto _end
    if /I "%_ok%" == "r" goto _reset
    goto _mainch


    :_getsrc
    set _ok=
    echo.
    echo Specify location of source to capture as a .wim image.
    echo Usually, this would be the root of a drive, such as C:\.
    echo.
    set /p _ok=Enter Source path:
    if exist "%_ok%" (
    setx _csource %_ok%
    set _csource=%_ok%
    ) else (
    echo.
    echo ---------------------------------------
    echo Error: The path "%_ok%" does not exist.
    echo ---------------------------------------
    goto _getsrc
    pause
    )

    goto _main

    :_gettarget
    set targ=
    echo.
    echo Specify path and filename to store the target image, such as D:\image.wim.
    echo.
    set /p _ok=Enter Target image path:
    for %%A in (%_ok%) do set _ext=%%~xA && set _path=%%~dpA
    if /I "%_ext%"==" " (
    echo.
    echo -----------------------------------------------------
    echo Error: The filename entered is not a valid .wim file.
    echo -----------------------------------------------------
    goto _gettarget
    ) else (
    if exist %_ok% (
    set _ctarget=%_ok%
    setx _ctarget %_ok%
    set _append=yes
    setx _append yes
    goto _main
    ) else (
    if not exist %_path% (
    echo.
    echo -----------------------------------------------------
    echo Path does not exist. Please input a valid path again.
    echo -----------------------------------------------------
    goto _gettarget
    ) else (
    setx _ctarget %_ok%
    set _ctarget=%_ok%
    set _append=no
    setx _append no
    goto _main
    )
    )
    )

    :_getcompr
    set comp =
    echo.
    echo Please select compression type.
    echo.
    echo 1 for maximum
    echo 2 for fast
    echo 3 for none
    echo.
    set /p type=Enter compression type:
    if %type%==1 set _compr=MAXIMUM&& setx _compr MAXIMUM
    if %type%==2 set _compr=FAST&& setx _compr FAST
    if %type%==3 set _compr=NONE&& setx _compr NONE

    goto _main

    :_getFLAG
    set _ok=
    echo.
    echo Specify image FLAG.
    echo.
    set /p _ok=Enter FLAG:
    set _FLAG=%_ok%
    setx _FLAG %_ok%

    goto _main

    :_getdescript
    set _ok=
    echo.
    echo Type description of image
    echo.
    set /p _ok=Enter description:
    set _descript=%_ok%
    setx _descript "%_ok%"
    goto _main

    :_capture
    echo.
    if "%_append%"=="yes" goto _appendimage
    echo Ready to capture image from source %_csource% and store image to
    echo %_ctarget% using compression type %_compr%.
    echo.
    pause
    echo.
    echo on
    "%imgx%\imagex.exe" /capture %_csource% "%_ctarget%" "%_FLAG%" "%_descript%" /COMPRESS %_compr%
    echo off
    pause
    goto _end

    :_appendimage
    echo.
    echo Ready to append image from source %_csource% and store image to
    echo %_ctarget%.
    echo.
    pause
    echo.
    echo on
    "%imgx%\imagex.exe" /append %_csource% "%_ctarget%" "%_descript%"
    echo off
    pause
    echo.
    goto _end

    :_reset
    @echo off
    set _csource=
    set _ctarget=
    set _descript=
    set _compr=
    set _FLAG=
    set _append=
    goto _main

    :_end