yweiss
Content Type
Profiles
Forums
Events
Posts posted by yweiss
-
-
Thank you very much for your help!
can you do this script also in vbs with the same GUI? plz
@echo off
cd /d %~dp0
if not exist "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
if exist "%_ctarget%" set _append=yes
if not exist "%_ctarget%" set _append=no
if /i "%_append%"=="yes" set function=Append
if /i "%_append%"=="no" set function=Capture
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 (MAXIMU, FAST, NONE)
echo Compression: [%_compr%]
echo.
if "%_csource%" == "" goto _menu1
if "%_ctarget%" == "" goto _menu1
if "%_descript%" == "" goto _menu1
if "%_append%" == "yes" goto _skipcapture
if "%_FLAG%" == "" goto _menu1
if "%_compr%" == "" goto _menu1
:_skipcapture
echo 6) %function% 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
)
goto _main
:_gettarget
set _ok=
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 not "%_ext%"==".wim " (
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 (without quotes).
echo.
set /p _ok=Enter FLAG:
set _FLAG=%_ok%
setx _FLAG %_ok%
goto _main
:_getdescript
set _ok=
echo.
echo Type description of image (without quotes).
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 file
echo %_ctarget% using compression type %_compr%.
echo.
pause
echo.
@echo on
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 file
echo %_ctarget%.
echo.
pause
echo.
@echo on
imagex.exe /append "%_csource%" "%_ctarget%" "%_descript%"
@echo off
pause
echo.
goto _end
:_reset
set _csource=
set _ctarget=
set _descript=
set _compr=
set _FLAG=
set _append=
goto _main
:_end10x a lot man
0 -
10x i will check it
but i i think there is problem
C:\Program Files\Windows AIK\Tools\x86\imagex.exe" /apply ' & $source & " " & $index & " " & $drive
i run the script from winpe dvd disk and the imagex is not in this path, it in x:\windows\system32\imagex.exe
so how can i change it?
and i prefare it in batch script
and what about the last command: d:\windows\system32\bcdboot d:\windows
?
0 -
yozel
the new script you did is not working...
when i try to choose my .wim file the script just close
and when i choose the target folder its keep telling me that the path is invaild (even when i choose exit folder)
can you plz help me??
and if you can help me with the command
d:\windows\system32 bcdboot d:\windows - i want that the script will do this command but before he will ask me where i apllyied the wim file and then it will run from this partition
10x
0 -
Hello,
I'm using this great batch script to capture and apply my image
@echo off
cd /d %~dp0
if not exist "imagex.exe" goto _notexist
goto _main
:_notexist
echo.
echo IMAGEX.EXE executable not found. Please ensure that IMAGEX_APPLY.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 A P P L Y M A I N M E N U]
echo.
echo 1) Specify or change source path (the path to you .wim image file)
echo Source: [%_asource%]
echo.
echo 2) Specify or change target path, where your image will be restored
echo Target: [%_atarget%]
echo.
echo 3) Specify or change index you want to restore (a number, such as 2)
echo Index: [%_index%]
echo.
if "%_asource%" == "" goto _menu1
if "%_atarget%" == "" goto _menu1
if "%_index%" == "" goto _menu1
echo 4) Apply your image now where ready
echo From [%_asource%] To [%_atarget%]
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 _getindex
if "%_ok%" == "4" goto _apply
if /I "%_ok%" == "q" goto _end
if /I "%_ok%" == "r" goto _reset
goto _mainch
:_getsrc
set _ok=
echo.
echo Specify location of source image to restore with full path.
set /p _ok=Enter Source path:
for %%A in (%_ok%) do set _ext=%%~xA
if not exist %_ok% (
echo.
echo ---------------------------------------------------------
echo Path does not exist. Please input a valid location again.
echo ---------------------------------------------------------
goto _getsrc
) else (
if /I "%_ext%"==".wim" (
set _asource=%_ok%
setx _asource %_ok%
goto _main
) else (
echo.
echo ---------------------------------------------------------------
echo Error: The path "%_ok%" does not seem to be a valid .wim image file.
echo ---------------------------------------------------------------
goto _getsrc
)
)
:_gettarget
set _ok=
echo.
echo Specify target to install source image with full path.
set /p _ok=Enter Target path:
if exist "%_ok%" (
set _atarget=%_ok%
setx _atarget %_ok%
) else (
echo.
echo ---------------------------------------------------------------
echo Error: The path "%_ok%" is not a correct location.
echo ---------------------------------------------------------------
goto _gettarget
)
goto _main
:_getindex
set _ok=
echo.
echo Specify image index with a number
set /p _ok=Enter Index number:
set _index=%_ok%
setx _index %_ok%
goto _main
:_apply
echo.
echo.
@echo on
imagex.exe /apply "%_asource%" %_index% "%_atarget%"
@echo off
echo.
pause
goto _end
:_reset
set _asource=
set _index=
set _atarget=
goto _main
:_endbut there is a problem that when i want to choose my .wim file it keep say to me that : Error: The path "%_ok%" does not seem to be a valid .wim image file.
even when i put the correct full path for the wim file
someone can help me with it?
and also i want that after the apply prcess complete the script will run the next command
d:\windows\system32\bcdboot d:\windows
when d: is the drive that the wim file was install to (the hard drive that windows will be in it) so i want that the script will ask for the drive letter or will use one of the variabels from it
10x
0
Batch script for imagex error
in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Posted
Hello again
someone can help me to make the batch script for capture the .wim file to a Autiit GUI ?
and also GUI with buttons that if i press on it it will start the aimagex_gui.exe apply and the imagex_gui_compress.exe ?
10x a lot!!