A simple, not bulletproof, method may look something like this:
@ECHO OFF
SET "FLAG="
FOR %%A IN ("%PATH:;=";"%") DO IF /I %%A=="%SystemRoot%\system32" SET "FLAG=T"
IF DEFINED FLAG ECHO The location exists as an entry in %%PATH%%
TIMEOUT -1
It will work correctly if you do not have paths with ;
or "
.
Edit
If you are unlucky enough to have entries using double quotes, you could use a slightly different method which replaces each semi-colon with a line feed character:
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET "FLAG="
SET LF=^
%FLAG%
%FLAG%
FOR /F "DELIMS=" %%A IN ("%PATH:;=!LF!%"
) DO IF /I "%%A"=="%SystemRoot%\system32" SET "FLAG=T"
IF DEFINED FLAG ECHO The location exists as an entry in %%PATH%%
TIMEOUT -1