I try use this code (work very well):
setlocal enabledelayedexpansion & set "WP=(wordA) (wordB) (wordC)" & set "WN=wordBB"
IF NOT "!WP:(%WN%)=!"=="!WP!" (echo found) ELSE (echo Not found)
But this not work (for use in vbscript):
cmd /v /c "setlocal enabledelayedexpansion & set "WP=(wordA) (wordB) (wordC)" & set "WN=wordBB" & IF NOT "!WP:(%WN%)=!"=="!WP!" (echo found) ELSE (echo Not found)"
What am I doing wrong?
EDIT:
This is a better example in my case:
cmd /v:on /c "@echo off & set "WP=(v0) (v2) (v6) (v4)" & (for %a in (v1 v2 v3 v4) do set "WN=%a" & if not \"!WP:(%WN%)=!\"==\"!WP!\" (echo Found %a) else (echo not %a) ) & pause"
I need use !WN! variable to search a string in !WP! (I can not use %a directly because !WN! is a filter for other functions ...
What i need to fix this?