Find will NOT find EXACT input!
Posted: 09 Jun 2020 13:25
Good evening,
I have the following which I have spent hours on . . .
It does work if I enter an installed KB number like KB2479943 for example.
But if I input KB247994 it is still searching for KB2479943.
I have tried . . .
. . . both at the top AND the bottom of the code without any luck!
I even tried findstr.
How do I get it to search for an EXACT match ONLY please?
Thanks in advance.
I have the following which I have spent hours on . . .
Code: Select all
@echo off
set KB_Number=
set /p KB_Number=^>Enter the KB Number: KB
if [%KB_Number%]==[] (
echo Invalid.
pause
goto :Exit
) else (
echo Checking if KB%KB_Number% is installed . . .
)
wmic qfe get hotfixid | find /I "KB%KB_Number%"
if %errorlevel% equ 1 (
echo NOT INSTALLED.
) else (
echo INSTALLED.
)
pause
goto :Exit
exit
But if I input KB247994 it is still searching for KB2479943.
I have tried . . .
Code: Select all
set KB_Number=""
set KB_Number=nul
I even tried findstr.
How do I get it to search for an EXACT match ONLY please?
Thanks in advance.