in general I could use findstr to search for quotes:
Code: Select all
findstr /C:""" "someFilecontainingQuotes"
Within a script this would work:
Code: Select all
echo !amPar_Servername!|findstr /C:"""
And this would work because of the even number of quotes in the for-loop:
Code: Select all
for /f "delims== tokens=1,*" %%i in ('findstr /C:"a" "!ParamTestLog!"') do (
echo PI=%%i
)
But this does not work because the for-Loop does not allow for an uneven number of quotes which findstr does allow:
Code: Select all
for /f "delims== tokens=1,*" %%i in ('findstr /C:""" "!ParamTestLog!"') do (
echo PI=%%i
)
Would anyone have a workaround?
I need to make sure that a certain file - which contains Parameters set by users of my script - does NOT contain any Quotes.
This logic should be part of my script.
Thank you
Andi