Reputation: 553
I have the following for loop
for /f "tokens=1* delims=;" %%a in ("%FORMS60_PATH%") do (
echo %%a | findstr /i /r SAM
)
what it does is read a registry key, FORMS60_PATH. the registry key as the value - c:\sam;c:\sape
It searchs the key if it has SAM in it and returns c:\sam if valid The question is ...how can I set this value to a variable?
Upvotes: 0
Views: 81
Reputation: 57252
for /f "tokens=1* delims=;" %%a in ("%FORMS60_PATH%") do (
echo %%a | findstr /i /r SAM && (
set "variable=%%a"
)
)
echo %variable%
?
Upvotes: 1