I am making a script that can find multiple strings in an command output. For example, here is my output after running the command:
Mount Dir : D:\mount
Image File : F:\sources\boot.wim
Image Index : 1
Mounted Read/Write : No
Status : Needs Remount
I want the batch file to find the strings "D:\mount" and "Needs remount" in the output and they have to both match to give an output, but the problem is it keeps showing the wrong string:
Dir
Press any key to continue...
Needs
Press any key to continue...
I know the problems are in the delimiters, but even if I change it, the results are still the same. Here is the code that I used:
@echo off
for /f "tokens=2 delims=: " %%a in ('dism /get-mountedimageinfo ^| findstr /i /c:"Dir" /c:"status"') do (
@echo %%a
pause
)
Please help me out. Thanks in advance