There is no findstr.exe in WinPE. So I wish to use find.exe to do the things: Code: findstr /i Index Code: findstr /i /C:"Index : %INDEX%" Thanks.
pretty similar, except you just use: Code: find /i "blahblah" if %ERRORLEVEL% neq 0 do (some error stuff here) The quotes are required. /i just ignores case, but I've had trouble using the command correctly when it's not used.
Thank you. And how about Code: findstr /i /C:"Index : %INDEX%" It needs to be exact string, like "Index : 1". Otherwise the output shall go wrong for there may have other numbers in WIM info. (I am using findstr.exe to detect images in a wim with help of Slave77. so much obliged.)
No. It won't. Code: @ECHO OFF :menuLOOP echo. echo.= Menu ================================================= echo. for /f "tokens=2 delims=: " %%a in ('dism /English /Get-WimInfo /WimFile:d:\install.esd ^| findstr /i Index') do ( for /f "tokens=2 delims=:" %%g in ('dism /English /Get-WimInfo /WimFile:d:\install.esd /Index:%%a ^| findstr /i Name') do ( echo %%a : %%g ) ) set INDEX= echo.&set /p INDEX=Input an Index number and hit ENTER to install: ||goto:menuLOOP dism /Get-WimInfo /WimFile:d:\install.esd | findstr /i /C:"Index : %INDEX%" >nul 2>&1 if %errorlevel% NEQ 0 (echo.&echo Wrong number!&echo.&pause&goto:menuLOOP) pause findstr.exe Murphy78's Win81AIO-S14-20in1-x86-en-US-Mar2014.iso Code: = Menu ================================================= 1 : Windows 8.1 (Core) S2014 2 : Windows 8.1 (Core) S2014 KMS-Activated 3 : Windows 8.1 (Core) N S2014 4 : Windows 8.1 (Core) N S2014 KMS-Activated 5 : Windows 8.1 (Core) SL S2014 6 : Windows 8.1 (Core) Single Language S2014 KMS-Activated 7 : Windows 8.1 Pro S2014 8 : Windows 8.1 Pro S2014 KMS-Activated 9 : Windows 8.1 Pro N S2014 10 : Windows 8.1 Pro N S2014 KMS-Activated 11 : Windows 8.1 Pro VL S2014 12 : Windows 8.1 Pro VL S2014 KMS-Activated 13 : Windows 8.1 Pro N VL S2014 14 : Windows 8.1 Pro N VL S2014 KMS-Activated 15 : Windows 8.1 Pro WMC S2014 16 : Windows 8.1 ProWMC S2014 KMS-Activated 17 : Windows 8.1 Enterprise S2014 18 : Windows 8.1 Enterprise S2014 KMS-Activated 19 : Windows 8.1 Enterprise N S2014 20 : Windows 8.1 Enterprise N S2014 KMS-Activated Input an Index number and hit ENTER to install: find.exe Code: = Menu ================================================= FIND: Parameter format not correct Input an Index number and hit ENTER to install:
You maybe did it wrong... try this: Code: @ECHO OFF :menuLOOP echo. echo.= Menu ================================================= echo. for /f "tokens=2 delims=: " %%a in ('dism /English /Get-WimInfo /WimFile:d:\install.esd ^| find /i "Index"') do ( for /f "tokens=2 delims=:" %%g in ('dism /English /Get-WimInfo /WimFile:d:\install.esd /Index:%%a ^| find /i "Name"') do ( echo %%a : %%g ) ) set INDEX= echo.&set /p INDEX=Input an Index number and hit ENTER to install: ||goto:menuLOOP dism /Get-WimInfo /WimFile:d:\install.esd | find /i "Index : %INDEX%" >nul 2>&1 if %errorlevel% NEQ 0 (echo.&echo Wrong number!&echo.&pause&goto:menuLOOP) pause
You are so great! It worked with quotes only. Code: = Menu ================================================= 1 : Windows 8.1 (Core) S2014 2 : Windows 8.1 (Core) S2014 KMS-Activated 3 : Windows 8.1 (Core) N S2014 4 : Windows 8.1 (Core) N S2014 KMS-Activated 5 : Windows 8.1 (Core) SL S2014 6 : Windows 8.1 (Core) Single Language S2014 KMS-Activated 7 : Windows 8.1 Pro S2014 8 : Windows 8.1 Pro S2014 KMS-Activated 9 : Windows 8.1 Pro N S2014 10 : Windows 8.1 Pro N S2014 KMS-Activated 11 : Windows 8.1 Pro VL S2014 12 : Windows 8.1 Pro VL S2014 KMS-Activated 13 : Windows 8.1 Pro N VL S2014 14 : Windows 8.1 Pro N VL S2014 KMS-Activated 15 : Windows 8.1 Pro WMC S2014 16 : Windows 8.1 ProWMC S2014 KMS-Activated 17 : Windows 8.1 Enterprise S2014 18 : Windows 8.1 Enterprise S2014 KMS-Activated 19 : Windows 8.1 Enterprise N S2014 20 : Windows 8.1 Enterprise N S2014 KMS-Activated Input an Index number and hit ENTER to install: 30 Wrong number! Press any key to continue . . . Thank you. With this, there's no need to have 20 boot.wim for WIMBoot AIO. Thanks a lot.