The expansion of variables inside FOR loops requires you to enable delayed expansion to force variables to be expanded at runtime instead of being expanded when parsed. Read HELP SET for more information.
And try changing your code to
@echo off
setlocal enabledelayedexpansion
SET CLIENTS=blah1:blah2
set CLIENTS=%CLIENTS::= %
for %%x in (%CLIENTS%) do (
SET client=%%x
echo !client!;
if "%1"=="!client!" goto end
)
:end
Note that the variable is referenced with an slightly different syntax !client! instead of %client%. Delayed environment variable expansion allows you to use a different character (the exclamation mark) to expand environment variables at execution time.